No.21423¡¡Re: °ìÈ̲½Àþ·Á¥â¥Ç¥ë¤Î¥ê¥ó¥¯´Ø¿ô¤Ë¤Ä¤¤¤Æ¡¡¡¡¡ÚÀÄÌÚÈË¿¡Û¡¡2014/10/30(Thu) 11:22
´ÝÉÕ¤¿ô»ú¤Ï»È¤ï¤Ê¤¤¤Ç¤È¡¤¾å¤ÎÊý¤Ë½ñ¤¤¤Æ¤¢¤ê¤Þ¤¹¡£
¤µ¤Æ¡¤¤ª¤ª¤â¤È¤ÎÍýÏÀ¶ÊÀþ¤Ï y = a*b^x ¤À¤È¤¤¤¦¤³¤È¤Ç¤·¤ç¤¦¤«¡©
½¾Â°ÊÑ¿ô¤òÂпôÊÑ´¹¤·¤Æ lm ¤òŬÍѤ¹¤ë¤È¤¤¤¦¤Î¤Ï¡¤¶á»÷ÃͤȤ¤¤¦¤«¡¤log(y) ¤Î¸íº¹¤¬Àµµ¬Ê¬ÉۤȤ¤¤¦¤³¤È¤ò²¾Äꤹ¤ë¤â¤Î¤Ç¤¹¡£
glm ¤Ç family=gaussian(link="log") ¤ò»ØÄꤷ¤¿¤È¤¤Ë¼ÂºÝ¤Ë¤É¤Î¤è¤¦¤Ë·×»»¤µ¤ì¤ë¤Î¤«¤Ï»ä¤Ë¤Ï¥Õ¥©¥í¡¼¤Ç¤¤Þ¤»¤ó¤¬¡¤nls ¤ÇÈóÀþ·Á²óµ¢¤·¤ÆľÀÜ y = a*b^x ¤Î¡¤a, b ¤òµá¤á¤ë¾ì¹ç¤È¤Û¤È¤ó¤ÉƱ¤¸·ë²Ì¤Ë¤Ê¤ê¤Þ¤¹¡£¤Þ¤¿¡¤ÈóÀþ·Á²óµ¢¤Ç¤Ï¡¤ÅöÁ³¤Ç¤¹¤¬¡¤½¾Â°ÊÑ¿ô¤¬ 0 ¤Ç¤¢¤ë¾ì¹ç¤â²¿¤ÎÌäÂê¤â¤¢¤ê¤Þ¤»¤ó¡£
¤È¤¤¤¦¤³¤È¤Ç¡¤¤¢¤Ê¤¿¤Î¾ì¹ç¤Ë¤ÏÈóÀþ·Á²óµ¢¤Ç¤è¤¤¤Î¤Ç¤Ï¡©
½¾Â°ÊÑ¿ô¤¬ 0 ¤Ë¤Ê¤ë¥Ç¡¼¥¿¤ò½ü¤¤¤Æ¡¤lm, glm, nls ¤ò»î¤·¤ÆÈæ³Ó¤¹¤ë¤È¤è¤¤¤Ç¤·¤ç¤¦¡£
No.21424¡¡Re: °ìÈ̲½Àþ·Á¥â¥Ç¥ë¤Î¥ê¥ó¥¯´Ø¿ô¤Ë¤Ä¤¤¤Æ¡¡¡¡¡ÚÃÝÅÄ¡Û¡¡2014/10/30(Thu) 12:29
ÀÄÌÚÀèÀ¸
Ãí°Õ»ö¹à¤ò¤è¤¯Æɤó¤Ç¤ª¤é¤º¿½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¡£
ÁáµÞ¤Ê¤´²óÅú¡¤¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
Àè¹Ô¸¦µæÆâ¤Ë¤ª¤ª¤â¤È¤ÎÍýÏÀ¶ÊÀþ¤Ë´Ø¤¹¤ëµ½Ò¤Ï¤Ê¤¤¤Î¤Ç¤¹¤¬¡¤¹Ô¤ï¤ì¤Æ¤¤¤ë²òÀϤȤ·¤Þ¤·¤Æ¤Ï¡¤
ÀèÀ¸¤¬¤ª¤Ã¤·¤ã¤é¤ì¤¿"y = a*b^x"¤Î¼°¤Îb¤Ë¤¢¤¿¤ëÉôʬ¤ò¿äÄꤷ¤Æ¤¤¤Þ¤¹¡£
Áᮡ¤½¾Â°ÊÑ¿ô¤¬0¤Ë¤Ê¤ë¥Ç¡¼¥¿¤ò½ü¤¤¤Æ¡¤lm()¡¤glm()¡¤nls()¤ò»î¤·¤Æ¤ß¤Þ¤·¤¿¡£
·ë²Ì¤È¤·¤Þ¤·¤Æ¤Ï¡¤glm()¡¤nls()¤¬¤Û¤È¤ó¤ÉƱ¤¸·ë²Ì(¸º¾¯Â®ÅÙ¡©¤Ç¤¤¤¦¤È0.01%°Ê²¼¤Îº¹)¡¤lm()¤¬·ë¹½°ã¤¦·ë²Ì(Ʊ¤¸¤¯¸º¾¯Â®ÅÙ¡©¤Ç¤¤¤¦¤È10¡ó¤Û¤É°ã¤¦)¤¬ÆÀ¤é¤ì¤Þ¤·¤¿¡£
¤³¤ì¤Ïnls()¡¤¤â¤·¤¯¤Ïglm()¤ò»È¤Ã¤¿¤Û¤¦¤¬¤è¤¤¤È¤¤¤¦²ò¼á¤Ë¤Ê¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©
¤Þ¤¿¡¤Â³¤±¤Æ¤Î¼ÁÌä¤Ç¿½¤·Ìõ¤Ê¤¤¤Î¤Ç¤¹¤¬¡¤»ä¤Î¸¦µæ¤Ç¤Ï¡Ö¸º¾¯Â®Å٤Υ°¥ë¡¼¥×º¹(3¥°¥ë¡¼¥×)¡×¤â¤ß¤ëͽÄê¤Ç¤¹¡£
glm()¤Ç¤Ï¡¤¥°¥ë¡¼¥×¤Î¥«¥Æ¥´¥ê¡¼¤òÀâÌÀÊÑ¿ô¤ËÆþ¤ì¤ë¶¦Ê¬»¶Ê¬ÀϤηÁ¤ò¤È¤ì¤Ð¤è¤¤¤È¹Í¤¨¤Æ¤¤¤ë¤Î¤Ç¤¹¤¬¡¤
nls()¤Î¾ì¹ç¤Ï¡¤¥°¥ë¡¼¥×¤´¤È¤Ë·¸¿ô¤ò¿äÄꤹ¤ë·Á¤Ë¤Ê¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©
ÂçÊÑ̵ÃΤǿ½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¤¬¡¤¤´²óÅú¤¤¤¿¤À¤±¤ì¤Ð¤È¸¤¸¤Þ¤¹¡£
²¿Â´¤è¤í¤·¤¯¤ª´ê¤¤¿½¤·¾å¤²¤Þ¤¹¡£
No.21425¡¡Re: °ìÈ̲½Àþ·Á¥â¥Ç¥ë¤Î¥ê¥ó¥¯´Ø¿ô¤Ë¤Ä¤¤¤Æ¡¡¡¡¡ÚÀÄÌÚÈË¿¡Û¡¡2014/10/30(Thu) 13:06
> ¤³¤ì¤Ïnls()¡¤¤â¤·¤¯¤Ïglm()¤ò»È¤Ã¤¿¤Û¤¦¤¬¤è¤¤¤È¤¤¤¦²ò¼á¤Ë¤Ê¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©
Åú¤Îʬ¤«¤Ã¤Æ¤¤¤ë¥Ç¡¼¥¿¤ò»È¤Ã¤ÆʬÀϤ·¤Æ¤ß¤ë¤È¤è¤¤¤Ç¤·¤ç¤¦¡£
°Ê²¼¤Î¥Ç¡¼¥¿¤Ï a=20¡¤b=0.85 ¤Çºî¤ê¡¤¾®¿ôÅÀ°Ê²¼7·å¤Þ¤Ç¼¨¤·¤¿¤â¤Î¡£x ynls ¤Ç¤Ï
0 20.0000000
1 17.0000000
2 14.4500000
3 12.2825000
4 10.4401250
5 8.8741062
6 7.5429903
7 6.4115418
8 5.4498105
9 4.6323389
10 3.9374881
11 3.3468649
12 2.8448351
13 2.4181099
14 2.0553934
15 1.7470844> ans3 <- nls(y ~ a*b^x, start=list(a=20, b=0.85))¤È¤Ê¤ë¡£lm, glm ¤Ç¤Ï¤¤¤¯¤Ä¤Ë¤Ê¤ë¤«¡£Èæ³Ó¤¹¤ì¤Ð·ëÏÀ¤ÏÌÀ³Î¡£¹¹¤Ë¡¤y=0 ¤Î¥Ç¡¼¥¿¤¬¤¢¤ì¤Ð1¤Ä¤Ë·è¤Þ¤ë¡£¡Ê¤Ã¤Æ¡¤Á°¤Î¥³¥á¥ó¥È¤Ë½ñ¤¤¤¿¡Ë
> summary(ans3)
Parameters:
Estimate Std. Error t value Pr(>|t|)
a 1.99999999954e+01 1.72868447474e-08 1156949130.26 < 2.22e-16
b 8.50000000006e-01 1.94419718026e-10 4371984532.42 < 2.22e-16
> glm()¤Ç¤Ï¡¤¥°¥ë¡¼¥×¤Î¥«¥Æ¥´¥ê¡¼¤òÀâÌÀÊÑ¿ô¤ËÆþ¤ì¤ë¶¦Ê¬»¶Ê¬ÀϤηÁ¤ò¤È¤ì¤Ð¤è¤¤¤È¹Í¤¨¤Æ¤¤¤ë¤Î¤Ç¤¹¤¬¡¤
¥°¥ë¡¼¥×Ê̤˿äÄꤹ¤ë¤Û¤¦¤¬¤è¤¤¤Ç¤·¤ç¤¦
No.21426¡¡Re: °ìÈ̲½Àþ·Á¥â¥Ç¥ë¤Î¥ê¥ó¥¯´Ø¿ô¤Ë¤Ä¤¤¤Æ¡¡¡¡¡ÚÃÝÅÄ¡Û¡¡2014/10/30(Thu) 18:10
ÀÄÌÚÀèÀ¸
ÃúÇ«¤Ê¤´ÀâÌÀ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
¼ÂºÝ¤Ë¼ê¤òÆ°¤«¤·¤Æ¤ß¤Æ¡¤¤è¤¦¤ä¤¯Ê¬¤«¤ê¤Þ¤·¤¿¡£
nls()¤ò»È¤ª¤¦¤È»×¤¦¤Î¤Ç¤¹¤¬¡¤º£¸å¤Î¤¿¤á¤Ë¤â¤¦1ÅÀ¶µ¤¨¤Æ¤¤¤¿¤À¤±¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡©
¤µ¤¤Û¤É¤¤¤¿¤À¤¤¤¿¥³¥á¥ó¥È¤ÎÃæ¤Ç
>¥°¥ë¡¼¥×Ê̤˿äÄꤹ¤ë¤Û¤¦¤¬¤è¤¤¤Ç¤·¤ç¤¦
¤È¤ª¤Ã¤·¤ã¤é¤ì¤Þ¤·¤¿¤¬¡¤¤³¤ì¤Ï¤É¤¦¤·¤Æ¤Ç¤·¤ç¤¦¤«¡©
3¥°¥ë¡¼¥×¤ÎÈæ³Ó¤Ê¤Î¤Ç¡¤¶¦Ê¬»¶Ê¬ÀϤΤߤÀ¤È¥°¥ë¡¼¥×¸Ä¡¹¤Îº¹¤Þ¤Ç¤Ï¸À¤¨¤º¡¤
¿½ÅÈæ³Ó¤ò¤·¤Ê¤±¤ì¤Ð¤¤¤±¤Ê¤¤¤«¤é¤Ç¤·¤ç¤¦¤«¡©
¤½¤ì¤È¤â¤Û¤«¤ÎÍýͳ¡¤Î㤨¤Ð¥°¥ë¡¼¥×Ê̤˥â¥Ç¥ë¤òºîÀ®¤·¤¿¤Û¤¦¤¬¡¤·¸¿ô¤Î¿äÄê¤ÎÀºÅÙ¤¬¾å¤¬¤Ã¤¿¤ê¤¹¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©
Ū³°¤ì¤Ê¼ÁÌä¤Ç¤·¤¿¤é¿½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¡£
¤³¤ó¤Ê¤Ë¼ÁÌä¤ò¤·¤Æ¤Ð¤Ã¤«¤ê¤Ç¤è¤¤¤â¤Î¤«¤ï¤«¤ê¤Þ¤»¤ó¤¬¡¤¤´²óÅú¤Î¤Û¤É²¿Â´¤è¤í¤·¤¯¤ª´ê¤¤¿½¤·¾å¤²¤Þ¤¹¡£
No.21427¡¡Re: °ìÈ̲½Àþ·Á¥â¥Ç¥ë¤Î¥ê¥ó¥¯´Ø¿ô¤Ë¤Ä¤¤¤Æ¡¡¡¡¡ÚÀÄÌÚÈË¿¡Û¡¡2014/10/30(Thu) 18:31
¤³¤Î¼ÁÌä¤â¡¤¼ÂºÝ¤ËÅú¤ÎÌÀ¤é¤«¤Ê¥Æ¥¹¥È¥Ç¡¼¥¿¤Ç¼ÂºÝ¤ËʬÀϤ·¤Æ¤ß¤ë¤È¤è¤¤¤Ç¤·¤ç¤¦¡£
¤¢¤Ê¤¿¤Î¤ä¤í¤¦¤È¤·¤Æ¤¤¤ë¤³¤È¤Ç¡¤¡Ö¥°¥ë¡¼¥×Ê̤η¸¿ô b ¤Ï¿äÄê¤Ç¤¤Þ¤¹¤«¡©¡×
No.21428¡¡Re: °ìÈ̲½Àþ·Á¥â¥Ç¥ë¤Î¥ê¥ó¥¯´Ø¿ô¤Ë¤Ä¤¤¤Æ¡¡¡¡¡ÚÃÝÅÄ¡Û¡¡2014/10/30(Thu) 20:53
ÀÄÌÚÀèÀ¸
²¿Å٤⤪¼ê¿ô¤ò¤ª¤«¤±¤·¤Æ¿½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¡£
Àè¤Û¤É¤ÎÀÄÌÚÀèÀ¸¤Î¥Ç¡¼¥¿¤Ë°ìÉôÄɲ䷤ơ¤glm()¤Ç¿äÄꤷ¤Æ¤ß¤Þ¤·¤¿¡£
x y group
0 20.0000000 A
1 17.0000000 A
2 14.4500000 A
3 12.2825000 A
4 10.4401250 A
5 8.8741062 A
6 7.5429903 A
7 6.4115418 A
8 5.4498105 A
9 4.6323389 A
10 3.9374881 A
11 3.3468649 A
12 2.8448351 A
13 2.4181099 A
14 2.0553934 A
15 1.7470844 A
0 30.0000000 B
1 22.5000000 B
2 17.3250000 B
3 13.3402500 B
4 10.2719925 B
5 7.9094342 B
6 6.0902644 B
7 4.6895036 B
8 3.6109177 B
9 2.7804067 B
10 2.1409131 B
11 1.6485031 B
12 1.2693474 B
13 0.9773975 B
14 0.7525961 B
15 0.5794990 B
0 40.0000000 C
1 36.4000000 C
2 33.1240000 C
3 30.1428400 C
4 27.4299844 C
5 24.9612858 C
6 22.7147701 C
7 20.6704408 C
8 18.8101011 C
9 17.1171920 C
10 15.5766447 C
11 14.1747467 C
12 12.8990195 C
13 11.7381077 C
14 10.6816781 C
15 9.7203270 C
y = a*b^x¤È¤¹¤ë¤È¡¤¥°¥ë¡¼¥×A¤Ï(a,b)=(20,0.85)¡¤B¤Ï(30,0.77)¡¤C¤Ï(40,0.91)¤Çºî¤Ã¤Æ¤¢¤ê¤Þ¤¹¡£
R¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ë¿äÄꤷ¤Þ¤·¤¿¡£
model<-glm(y~x*group,family=gaussian(link="log"),start=c(20,-0.1,1,1,-0.1,-0.1))
¤½¤Î·ë²Ì¡¤
> model$coefficient
(Intercept) x groupB groupC x:groupB x:groupC
2.99573227 -0.16251893 0.39648943 0.69314718 -0.10337401 0.06820825
> exp(model$coefficient[2])
x
0.85
> exp(model$coefficient[2]+model$coefficient[5])
x
0.7665212
> exp(model3$coefficient[2]+model3$coefficient[6])
x
0.91
¤È¤Ê¤ê¡¤¤ª¤ª¤è¤½¶á¤¤·ë²Ì¤¬ÆÀ¤é¤ì¤Þ¤·¤¿¡£
ÀÚÊҤ˴ؤ·¤Æ¤âƱÍͤǤ¹¡£
¥Ç¡¼¥¿¤Îºî¤êÊý¡¤glm()¤Î»È¤¤Êý¡¤¤É¤³¤¬¤É¤¦´Ö°ã¤Ã¤Æ¤¤¤ë¤Î¤«Ê¬¤«¤ê¤Þ¤»¤ó¡£
ËܻݤȤϤ«¤±Î¥¤ì¤¿ÆâÍƤǿ½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¤¬¡¤Æ¬¤¬º®Í𤷤Ƥ¤¤Þ¤¹¡£
¤É¤ÎÅÀ¤¬´Ö°ã¤Ã¤Æ¤¤¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©½õ¤±¤Æ¤¯¤À¤µ¤¤¡£
²¿Â´¤è¤í¤·¤¯¤ª´ê¤¤¿½¤·¾å¤²¤Þ¤¹¡£
No.21429¡¡Re: °ìÈ̲½Àþ·Á¥â¥Ç¥ë¤Î¥ê¥ó¥¯´Ø¿ô¤Ë¤Ä¤¤¤Æ¡¡¡¡¡ÚÀÄÌÚÈË¿¡Û¡¡2014/10/30(Thu) 21:03
´°àú¤Ç¤·¤ç¤¦¡£¥Ç¡¼¥¿¤¬¿¿¼Â¤ò¸ì¤Ã¤¿¤Î¤Ç¤¹¡£
No.21430¡¡Re: °ìÈ̲½Àþ·Á¥â¥Ç¥ë¤Î¥ê¥ó¥¯´Ø¿ô¤Ë¤Ä¤¤¤Æ¡¡¡¡¡ÚÃÝÅÄ¡Û¡¡2014/11/04(Tue) 10:53
ÀÄÌÚÀèÀ¸
Á´¤Æ¤Î¼ÁÌä¤ËÂФ·¤Æ¤ÎÃúÇ«¤Ê¤´ÊÖÅú¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
¡ü ¡ÖÅý·×³Ø´ØÏ¢¤Ê¤ó¤Ç¤â¤¢¤ê¡×¤Î²áµî¥í¥°--- 047 ¤ÎÌܼ¡¤Ø¥¸¥ã¥ó¥×
¡ü ¡ÖÅý·×³Ø´ØÏ¢¤Ê¤ó¤Ç¤â¤¢¤ê¡×¤ÎÌܼ¡¤Ø¥¸¥ã¥ó¥×
¡ü ľÁ°¤Î¥Ú¡¼¥¸¤ØÌá¤ë