Hi R users: I don?t know if anybody have had the same problem with 'step()' funtion. If I type the commands ------------------------------------------------------------------------------- testData<-read.table("testData.dat",header=T) model1J<-glm(MCHNV~offset(Offset1),data=testData,family="poisson") step(model1J,direction="forward", scope=(list(upper=~IA+IM+altura+Region+Region:IA+Region:IM+Region:altura+offset(Offset1), lower=~offset(Offset1)))) ------------------------------------------------------------------------------- I got the folowing error message: ------------------------------------------------------------------------------- . . Df Deviance AIC + IA:Region 8 540.24 1377.73 + IM 1 586.84 1410.32 + altura:Region 8 574.21 1411.70 <none> 600.74 1422.23 Step: AIC= 1377.73 MCHNV ~ Region + IA + altura + Region:IA + offset(Offset1) Error in factor.scope(ffac, list(add = fadd, drop = fdrop)) : upper scope does not include model ------------------------------------------------------------------------------- What am I doing wrong? Thank you for your help. I put here the database I use, so you can replicate the problem. (I am using R221 on WinXP) ------------------------------------------------------------------------------- testdata.dat "MCHNV" "IA" "IM" "altura" "Region" "Offset1" 215 26.9863956381346 1.07456622007468 2 "URABA" -0.185125484126689 325 21.443816698054 1.05477685097601 4 "URABA" 0.118671529717499 435 24.3172115328382 1.08970363580813 8 "URABA" 0.363948427905231 327 22.9861973271014 1.09309079792113 200 "URABA" 0.241376319575269 150 18.1768608561301 0.983952398124775 30 "BAJO CAUCA" -0.683196849706777 949 10.6563785744498 0.97821952889272 25 "URABA" 1.30128098679293 417 15.0910419778194 1.02464131763495 28 "URABA" 0.314810739840034 528 13.6340158642317 0.913249100021176 50 "BAJO CAUCA" 0.986562784859487 572 15.2055383362367 0.999321512574634 34 "URABA" 0.714908672341458 1255 16.9860295444068 1.00064160401003 2 "URABA" 1.54158724552593 517 17.9909267660402 1.00311566921978 50 "BAJO CAUCA" 0.67141268841394 221 26.714962883463 1.03642655495856 100 "BAJO CAUCA" -0.122167633974208 306 20.1507989217486 1.05350982751705 50 "BAJO CAUCA" 0.0411419433311752 274 27.4221304422647 1.03894736842105 125 "BAJO CAUCA" 0.0344014267173323 307 11.8064337044690 1.02694423605901 650 "NORDESTE" 0.242161557149972 203 25.7458563535912 1.02557953637090 75 "URABA" -0.608806032126194 258 27.2816742408892 1.08604552865165 1550 "NORTE" 0.340748793388473 126 26.0150722854506 0.9960092095165 1165 "NORTE" -0.551647618286246 88 21.6368286445013 1.10034379028792 1200 "NORTE" -0.901402119380404 85 25.1843952723718 1.05835010060362 1700 "NORTE" -0.763569644856491 75 18.6270125223614 1.09069658719028 1850 "NORTE" -1.03282454813011 64 29.9515311742675 1.08689655172414 1200 "OCCIDENTE" -1.03845836584836 77 26.2046204620462 1.11247966534976 650 "OCCIDENTE" -1.10563690360507 49 12.6096949435855 1.06872703695699 1475 "NORTE" -1.06421086195078 133 18.7464907355418 1.09098914000587 1535 "NORDESTE" -0.616186139423817 192 10.5534246575342 0.947705442902882 2300 "NORTE" 0.508021696433256 32 17.2654236774291 1.0462158808933 1875 "NORTE" -1.18417017702976 73 17.0988006853227 1.06583294006607 850 "OCCIDENTE" -1.04128722204884 139 15.3530911090010 1.03178310316816 1550 "NORDESTE" -0.245900538436826 52 19.3008705114255 1.02785822645152 1675 "NORTE" -0.473208760194684 17 6.27750073335289 0.95582329317269 2550 "NORTE" -1.69826912614072 307 26.0375981018434 1.03257159815996 450 "OCCIDENTE" 0.131028262406404 127 17.2681438238026 1.05732223283745 980 "NORDESTE" -0.520875959619492 182 15.4432793136320 1.05083088954057 700 "NORDESTE" -0.16960278438618 24 7.7125328659071 1.0375 1800 "NORTE" -1.76609172247948 51 30.1453193646502 1.18054532056006 25 "URABA" -2.21640739675299 141 14.8701064405557 1.08226897069872 1300 "OCCIDENTE" -0.138113302129634 40 24.7907034861927 1.08357198646186 1625 "OCCIDENTE" -1.18090753139494 76 17.3296398891967 1.11061739943873 1250 "NORDESTE" -1.11474167059799 40 10.7364199781261 1.09309423884014 700 "OCCIDENTE" -0.711311151187616 100 19.3800588668138 1.14100039385585 75 "MAGDALENA MEDIO" -0.86988435906 42 10.3085483055134 1.00222807372899 1800 "NORTE" -0.898942093539542 18 8.80185302168878 1.02085106382979 1925 "OCCIDENTE" -1.48722027970985 20 16.6951761888471 1.11658218682114 500 "OCCIDENTE" -1.99510039324608 18 4.50797141286421 1.08840413318025 2300 "NORTE" -1.22417551164346 75 6.84546862896979 0.940623825629463 1050 "NORDESTE" -0.648173814917214 26 8.21845174973489 1.07633027522936 2550 "NORTE" -1.48722027970985 21 6.19588744588745 1.24954351795496 1920 "OCCIDENTE" -1.9241486572738 216 16.9889711436773 1.06553284443751 1350 "OCCIDENTE" 0.188137942115395 81 5.59826387611726 1.02449921811006 2550 "NORTE" 0.162968828278140 90 8.68694955964772 1.03136617100372 1450 "NORDESTE" -0.233193887167711 69 3.65186966980101 0.890711135611907 2200 "NORTE" -0.415515443961666 138 16.1123827476325 1.01692767267131 550 "OCCIDENTE" -0.139262067333508 79 9.67841682127396 1.05692478931468 750 "OCCIDENTE" -0.638658995275876 69 13.5423542354235 1.00617965129111 950 "MAGDALENA MEDIO" -0.97021907389971 52 5.6497484139138 1.01988510826337 2475 "NORTE" -0.136965855073157 59 8.7686432740111 1.02820400409177 1975 "NORDESTE" -0.512493680866688 69 11.9602529358627 1.00325732899023 780 "OCCIDENTE" -0.807436326962073 173 6.86294126054023 0.969987048820317 1300 "VALLE DE ABURRA" 0.436963775167535 29 19.2194992008524 1.0319350473613 1800 "SUROESTE" -1.26584820804402 118 4.64579055441478 0.948 1425 "VALLE DE ABURRA" 0.392717535285662 23 9.50905993495431 0.976430976430976 1875 "ORIENTE" -1.21739582465808 1456 2.79913286437223 0.912491945614184 1450 "VALLE DE ABURRA" 2.50894864426824 156 10.2515243902439 1.03805825242718 1475 "NORDESTE" -0.0693500781347932 26 8.66738894907909 1.01016333938294 1650 "ORIENTE" -1.53247687129797 208 3.6576768917803 0.934502240405221 1425 "VALLE DE ABURRA" 0.718814927308523 294 12.4953778763831 0.936918076139056 125 "MAGDALENA MEDIO" 0.368801123736573 84 15.2370770972205 1.03298389158783 1150 "OCCIDENTE" -0.398986142010455 57 21.2257484260568 1.06829657188414 625 "OCCIDENTE" -1.09961278900169 84 7.8413206434768 1.04918881601657 2150 "ORIENTE" 0.0295588022415444 121 12.5950805097303 1.04278074866310 1000 "ORIENTE" -0.162518929497775 112 6.23108480731724 0.99369804237061 2150 "ORIENTE" 0.272314595320659 25 4.72859966550099 1.00763125763126 1925 "ORIENTE" -1.20731170559145 9281 3.11622388590868 0.859808006713988 1550 "VALLE DE ABURRA" 4.33235045310693 36 15.9319508257792 1.06752246469833 1440 "OCCIDENTE" -1.09064411901893 71 6.69567319313512 0.976588628762542 2000 "ORIENTE" -0.369615455214467 812 2.47749261819931 0.900774538520513 1550 "VALLE DE ABURRA" 2.04485009691022 135 24.8112304583644 1.01435304198800 18 "URABA" -1.01060141134540 215 3.94306597422581 0.92939648374078 1775 "VALLE DE ABURRA" 0.580538236177291 94 2.71509876129896 0.934334930708457 1550 "VALLE DE ABURRA" 0.151002873536527 302 1.79760050991181 0.863916626564004 1575 "VALLE DE ABURRA" 1.57277392806251 148 4.80243967117475 1.00074278438031 2120 "ORIENTE" 0.579978482454307 42 18.7818696883853 1.02873563218391 1800 "OCCIDENTE" -1.17118298150295 84 5.24955116696589 0.882901764586573 2150 "ORIENTE" 0.407463110770837 114 19.0728713579217 1.05623621661358 1600 "SUROESTE" -0.269187489815617 54 12.6099706744868 1.09948152948801 1900 "SUROESTE" -1.26940060964839 309 3.58964845561636 0.971704768125408 2125 "ORIENTE" 1.20896034583698 148 11.3911041683795 1.01024708701760 1000 "ORIENTE" 0.0207825391825284 87 7.48350816481021 0.949198988195616 2050 "ORIENTE" -0.0693500781347932 75 15.0857882809971 0.999676323029616 1550 "SUROESTE" -0.659712404473708 275 19.6855832458419 0.99394006170119 1800 "SUROESTE" 0.441475545631197 171 12.2966073388367 1.02639721523883 375 "MAGDALENA MEDIO" -0.100925918589961 210 4.08228296275315 0.963297650493535 1750 "VALLE DE ABURRA" 0.789820067820206 209 21.4270750408514 1.02262711864407 2000 "SUROESTE" 0.0797349680188535 150 9.83262770545642 0.990626969124134 1400 "SUROESTE" 0.0168571170664228 69 6.28415300546448 1.02701607456437 2175 "ORIENTE" -0.502526820951296 157 4.2754914877677 0.962433460076046 2200 "ORIENTE" 0.56360780920496 110 10.4337099078042 1.05496997998666 1050 "ORIENTE" -0.391562202939173 93 13.9745206313318 0.995055517002082 1300 "ORIENTE" 0.0610950993598108 98 14.0491684743312 0.99971081550029 1350 "SUROESTE" -0.612489277542491 40 8.79131920024113 1.06194323596437 2350 "SUROESTE" -0.901402119380404 132 15.2282010300124 1.03248511099080 150 "MAGDALENA MEDIO" -0.62548853208613 155 19.1379750063759 1.06694781233527 1250 "SUROESTE" -0.151986356997882 152 6.89338235294118 1.01801801801802 2150 "ORIENTE" 0.630207380786071 62 5.51527398074409 1.01774793140664 2500 "ORIENTE" -0.331285709933913 52 18.3089033659066 1.01807723911257 1325 "SUROESTE" -1.09362474715707 50 23.5368956743003 1.03578996939016 1250 "ORIENTE" -0.999672340813206 124 10.3041872432253 1.00624427608026 1800 "SUROESTE" 0.0601539228197471 248 13.7563263088668 1.01527025469632 1100 "SUROESTE" 0.459953293392234 52 12.0249520153551 0.990068754774637 1800 "SUROESTE" -0.787457860031187 181 12.0066668763169 0.967759900990099 1800 "SUROESTE" 0.29266961396282 76 9.25797503467406 0.954370905805286 2000 "SUROESTE" -0.140412153716745 118 11.4912313643021 1.03321371306406 2125 "ORIENTE" 0.268499253035007 73 14.2689601250977 1.01163888015099 1750 "ORIENTE" -0.62548853208613 66 15.2254249815225 1.11626694473410 1550 "SUROESTE" -0.610645959048202 65 14.0718562874251 0.998290598290598 987.5 "SUROESTE" -0.884307686021104 75 9.21820303383897 0.964776990412672 1600 "SUROESTE" -0.136965855073157 33 9.9353894916494 1.00906196424198 2050 "SUROESTE" -1.01335244471729 71 8.6011885743498 1.01454685890834 1750 "SUROESTE" -0.372514007968479 84 14.7106815614409 1.04203511469947 1650 "ORIENTE" -0.375420986759788 223 8.6682462336269 0.990833036667853 2475 "ORIENTE" 0.745739630679116 229 10.9155102240965 1.02915422885572 1350 "SUROESTE" 0.673964361143171
It looks some your data has been wrapped around by the email processing. Suggest that after reading it in you issue the command: dput(testData) and put testData <- followed by the output from the dput into your email. On 3/23/06, Kenneth Cabrera <krcabrer at epm.net.co> wrote:> Hi R users: > > I don?t know if anybody have had the same problem with 'step()' funtion. > > If I type the commands > ------------------------------------------------------------------------------- > testData<-read.table("testData.dat",header=T) > model1J<-glm(MCHNV~offset(Offset1),data=testData,family="poisson") > step(model1J,direction="forward", > scope=(list(upper=~IA+IM+altura+Region+Region:IA+Region:IM+Region:altura+offset(Offset1), > lower=~offset(Offset1)))) > ------------------------------------------------------------------------------- > I got the folowing error message: > > ------------------------------------------------------------------------------- > . > . > Df Deviance AIC > + IA:Region 8 540.24 1377.73 > + IM 1 586.84 1410.32 > + altura:Region 8 574.21 1411.70 > <none> 600.74 1422.23 > > Step: AIC= 1377.73 > MCHNV ~ Region + IA + altura + Region:IA + offset(Offset1) > > Error in factor.scope(ffac, list(add = fadd, drop = fdrop)) : > upper scope does not include model > ------------------------------------------------------------------------------- > > What am I doing wrong? > > Thank you for your help. > > I put here the database I use, so you can replicate the problem. > (I am using R221 on WinXP) > > ------------------------------------------------------------------------------- > testdata.dat > > "MCHNV" "IA" "IM" "altura" "Region" "Offset1" > 215 26.9863956381346 1.07456622007468 2 "URABA" -0.185125484126689 > 325 21.443816698054 1.05477685097601 4 "URABA" 0.118671529717499 > 435 24.3172115328382 1.08970363580813 8 "URABA" 0.363948427905231 > 327 22.9861973271014 1.09309079792113 200 "URABA" 0.241376319575269 > 150 18.1768608561301 0.983952398124775 30 "BAJO CAUCA" -0.683196849706777 > 949 10.6563785744498 0.97821952889272 25 "URABA" 1.30128098679293 > 417 15.0910419778194 1.02464131763495 28 "URABA" 0.314810739840034 > 528 13.6340158642317 0.913249100021176 50 "BAJO CAUCA" 0.986562784859487 > 572 15.2055383362367 0.999321512574634 34 "URABA" 0.714908672341458 > 1255 16.9860295444068 1.00064160401003 2 "URABA" 1.54158724552593 > 517 17.9909267660402 1.00311566921978 50 "BAJO CAUCA" 0.67141268841394 > 221 26.714962883463 1.03642655495856 100 "BAJO CAUCA" -0.122167633974208 > 306 20.1507989217486 1.05350982751705 50 "BAJO CAUCA" 0.0411419433311752 > 274 27.4221304422647 1.03894736842105 125 "BAJO CAUCA" 0.0344014267173323 > 307 11.8064337044690 1.02694423605901 650 "NORDESTE" 0.242161557149972 > 203 25.7458563535912 1.02557953637090 75 "URABA" -0.608806032126194 > 258 27.2816742408892 1.08604552865165 1550 "NORTE" 0.340748793388473 > 126 26.0150722854506 0.9960092095165 1165 "NORTE" -0.551647618286246 > 88 21.6368286445013 1.10034379028792 1200 "NORTE" -0.901402119380404 > 85 25.1843952723718 1.05835010060362 1700 "NORTE" -0.763569644856491 > 75 18.6270125223614 1.09069658719028 1850 "NORTE" -1.03282454813011 > 64 29.9515311742675 1.08689655172414 1200 "OCCIDENTE" -1.03845836584836 > 77 26.2046204620462 1.11247966534976 650 "OCCIDENTE" -1.10563690360507 > 49 12.6096949435855 1.06872703695699 1475 "NORTE" -1.06421086195078 > 133 18.7464907355418 1.09098914000587 1535 "NORDESTE" -0.616186139423817 > 192 10.5534246575342 0.947705442902882 2300 "NORTE" 0.508021696433256 > 32 17.2654236774291 1.0462158808933 1875 "NORTE" -1.18417017702976 > 73 17.0988006853227 1.06583294006607 850 "OCCIDENTE" -1.04128722204884 > 139 15.3530911090010 1.03178310316816 1550 "NORDESTE" -0.245900538436826 > 52 19.3008705114255 1.02785822645152 1675 "NORTE" -0.473208760194684 > 17 6.27750073335289 0.95582329317269 2550 "NORTE" -1.69826912614072 > 307 26.0375981018434 1.03257159815996 450 "OCCIDENTE" 0.131028262406404 > 127 17.2681438238026 1.05732223283745 980 "NORDESTE" -0.520875959619492 > 182 15.4432793136320 1.05083088954057 700 "NORDESTE" -0.16960278438618 > 24 7.7125328659071 1.0375 1800 "NORTE" -1.76609172247948 > 51 30.1453193646502 1.18054532056006 25 "URABA" -2.21640739675299 > 141 14.8701064405557 1.08226897069872 1300 "OCCIDENTE" -0.138113302129634 > 40 24.7907034861927 1.08357198646186 1625 "OCCIDENTE" -1.18090753139494 > 76 17.3296398891967 1.11061739943873 1250 "NORDESTE" -1.11474167059799 > 40 10.7364199781261 1.09309423884014 700 "OCCIDENTE" -0.711311151187616 > 100 19.3800588668138 1.14100039385585 75 "MAGDALENA MEDIO" -0.86988435906 > 42 10.3085483055134 1.00222807372899 1800 "NORTE" -0.898942093539542 > 18 8.80185302168878 1.02085106382979 1925 "OCCIDENTE" -1.48722027970985 > 20 16.6951761888471 1.11658218682114 500 "OCCIDENTE" -1.99510039324608 > 18 4.50797141286421 1.08840413318025 2300 "NORTE" -1.22417551164346 > 75 6.84546862896979 0.940623825629463 1050 "NORDESTE" -0.648173814917214 > 26 8.21845174973489 1.07633027522936 2550 "NORTE" -1.48722027970985 > 21 6.19588744588745 1.24954351795496 1920 "OCCIDENTE" -1.9241486572738 > 216 16.9889711436773 1.06553284443751 1350 "OCCIDENTE" 0.188137942115395 > 81 5.59826387611726 1.02449921811006 2550 "NORTE" 0.162968828278140 > 90 8.68694955964772 1.03136617100372 1450 "NORDESTE" -0.233193887167711 > 69 3.65186966980101 0.890711135611907 2200 "NORTE" -0.415515443961666 > 138 16.1123827476325 1.01692767267131 550 "OCCIDENTE" -0.139262067333508 > 79 9.67841682127396 1.05692478931468 750 "OCCIDENTE" -0.638658995275876 > 69 13.5423542354235 1.00617965129111 950 "MAGDALENA MEDIO" > -0.97021907389971 > 52 5.6497484139138 1.01988510826337 2475 "NORTE" -0.136965855073157 > 59 8.7686432740111 1.02820400409177 1975 "NORDESTE" -0.512493680866688 > 69 11.9602529358627 1.00325732899023 780 "OCCIDENTE" -0.807436326962073 > 173 6.86294126054023 0.969987048820317 1300 "VALLE DE ABURRA" > 0.436963775167535 > 29 19.2194992008524 1.0319350473613 1800 "SUROESTE" -1.26584820804402 > 118 4.64579055441478 0.948 1425 "VALLE DE ABURRA" 0.392717535285662 > 23 9.50905993495431 0.976430976430976 1875 "ORIENTE" -1.21739582465808 > 1456 2.79913286437223 0.912491945614184 1450 "VALLE DE ABURRA" > 2.50894864426824 > 156 10.2515243902439 1.03805825242718 1475 "NORDESTE" -0.0693500781347932 > 26 8.66738894907909 1.01016333938294 1650 "ORIENTE" -1.53247687129797 > 208 3.6576768917803 0.934502240405221 1425 "VALLE DE ABURRA" > 0.718814927308523 > 294 12.4953778763831 0.936918076139056 125 "MAGDALENA MEDIO" > 0.368801123736573 > 84 15.2370770972205 1.03298389158783 1150 "OCCIDENTE" -0.398986142010455 > 57 21.2257484260568 1.06829657188414 625 "OCCIDENTE" -1.09961278900169 > 84 7.8413206434768 1.04918881601657 2150 "ORIENTE" 0.0295588022415444 > 121 12.5950805097303 1.04278074866310 1000 "ORIENTE" -0.162518929497775 > 112 6.23108480731724 0.99369804237061 2150 "ORIENTE" 0.272314595320659 > 25 4.72859966550099 1.00763125763126 1925 "ORIENTE" -1.20731170559145 > 9281 3.11622388590868 0.859808006713988 1550 "VALLE DE ABURRA" > 4.33235045310693 > 36 15.9319508257792 1.06752246469833 1440 "OCCIDENTE" -1.09064411901893 > 71 6.69567319313512 0.976588628762542 2000 "ORIENTE" -0.369615455214467 > 812 2.47749261819931 0.900774538520513 1550 "VALLE DE ABURRA" > 2.04485009691022 > 135 24.8112304583644 1.01435304198800 18 "URABA" -1.01060141134540 > 215 3.94306597422581 0.92939648374078 1775 "VALLE DE ABURRA" > 0.580538236177291 > 94 2.71509876129896 0.934334930708457 1550 "VALLE DE ABURRA" > 0.151002873536527 > 302 1.79760050991181 0.863916626564004 1575 "VALLE DE ABURRA" > 1.57277392806251 > 148 4.80243967117475 1.00074278438031 2120 "ORIENTE" 0.579978482454307 > 42 18.7818696883853 1.02873563218391 1800 "OCCIDENTE" -1.17118298150295 > 84 5.24955116696589 0.882901764586573 2150 "ORIENTE" 0.407463110770837 > 114 19.0728713579217 1.05623621661358 1600 "SUROESTE" -0.269187489815617 > 54 12.6099706744868 1.09948152948801 1900 "SUROESTE" -1.26940060964839 > 309 3.58964845561636 0.971704768125408 2125 "ORIENTE" 1.20896034583698 > 148 11.3911041683795 1.01024708701760 1000 "ORIENTE" 0.0207825391825284 > 87 7.48350816481021 0.949198988195616 2050 "ORIENTE" -0.0693500781347932 > 75 15.0857882809971 0.999676323029616 1550 "SUROESTE" -0.659712404473708 > 275 19.6855832458419 0.99394006170119 1800 "SUROESTE" 0.441475545631197 > 171 12.2966073388367 1.02639721523883 375 "MAGDALENA MEDIO" > -0.100925918589961 > 210 4.08228296275315 0.963297650493535 1750 "VALLE DE ABURRA" > 0.789820067820206 > 209 21.4270750408514 1.02262711864407 2000 "SUROESTE" 0.0797349680188535 > 150 9.83262770545642 0.990626969124134 1400 "SUROESTE" 0.0168571170664228 > 69 6.28415300546448 1.02701607456437 2175 "ORIENTE" -0.502526820951296 > 157 4.2754914877677 0.962433460076046 2200 "ORIENTE" 0.56360780920496 > 110 10.4337099078042 1.05496997998666 1050 "ORIENTE" -0.391562202939173 > 93 13.9745206313318 0.995055517002082 1300 "ORIENTE" 0.0610950993598108 > 98 14.0491684743312 0.99971081550029 1350 "SUROESTE" -0.612489277542491 > 40 8.79131920024113 1.06194323596437 2350 "SUROESTE" -0.901402119380404 > 132 15.2282010300124 1.03248511099080 150 "MAGDALENA MEDIO" > -0.62548853208613 > 155 19.1379750063759 1.06694781233527 1250 "SUROESTE" -0.151986356997882 > 152 6.89338235294118 1.01801801801802 2150 "ORIENTE" 0.630207380786071 > 62 5.51527398074409 1.01774793140664 2500 "ORIENTE" -0.331285709933913 > 52 18.3089033659066 1.01807723911257 1325 "SUROESTE" -1.09362474715707 > 50 23.5368956743003 1.03578996939016 1250 "ORIENTE" -0.999672340813206 > 124 10.3041872432253 1.00624427608026 1800 "SUROESTE" 0.0601539228197471 > 248 13.7563263088668 1.01527025469632 1100 "SUROESTE" 0.459953293392234 > 52 12.0249520153551 0.990068754774637 1800 "SUROESTE" -0.787457860031187 > 181 12.0066668763169 0.967759900990099 1800 "SUROESTE" 0.29266961396282 > 76 9.25797503467406 0.954370905805286 2000 "SUROESTE" -0.140412153716745 > 118 11.4912313643021 1.03321371306406 2125 "ORIENTE" 0.268499253035007 > 73 14.2689601250977 1.01163888015099 1750 "ORIENTE" -0.62548853208613 > 66 15.2254249815225 1.11626694473410 1550 "SUROESTE" -0.610645959048202 > 65 14.0718562874251 0.998290598290598 987.5 "SUROESTE" -0.884307686021104 > 75 9.21820303383897 0.964776990412672 1600 "SUROESTE" -0.136965855073157 > 33 9.9353894916494 1.00906196424198 2050 "SUROESTE" -1.01335244471729 > 71 8.6011885743498 1.01454685890834 1750 "SUROESTE" -0.372514007968479 > 84 14.7106815614409 1.04203511469947 1650 "ORIENTE" -0.375420986759788 > 223 8.6682462336269 0.990833036667853 2475 "ORIENTE" 0.745739630679116 > 229 10.9155102240965 1.02915422885572 1350 "SUROESTE" 0.673964361143171 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Ok Here is the complete command secuence -------------------------------------------------------------------------- testData<-structure(list(MCHNV = c(215, 325, 435, 327, 150, 949, 417, 528, 572, 1255, 517, 221, 306, 274, 307, 203, 258, 126, 88, 85, 75, 64, 77, 49, 133, 192, 32, 73, 139, 52, 17, 307, 127, 182, 24, 51, 141, 40, 76, 40, 100, 42, 18, 20, 18, 75, 26, 21, 216, 81, 90, 69, 138, 79, 69, 52, 59, 69, 173, 29, 118, 23, 1456, 156, 26, 208, 294, 84, 57, 84, 121, 112, 25, 9281, 36, 71, 812, 135, 215, 94, 302, 148, 42, 84, 114, 54, 309, 148, 87, 75, 275, 171, 210, 209, 150, 69, 157, 110, 93, 98, 40, 132, 155, 152, 62, 52, 50, 124, 248, 52, 181, 76, 118, 73, 66, 65, 75, 33, 71, 84, 223, 229), IA = c(26.9863956381346, 21.443816698054, 24.3172115328382, 22.9861973271014, 18.1768608561301, 10.6563785744498, 15.0910419778194, 13.6340158642317, 15.2055383362367, 16.9860295444068, 17.9909267660402, 26.714962883463, 20.1507989217486, 27.4221304422647, 11.806433704469, 25.7458563535912, 27.2816742408892, 26.0150722854506, 21.6368286445013, 25.1843952723718, 18.6270125223614, 29.9515311742675, 26.2046204620462, 12.6096949435855, 18.7464907355418, 10.5534246575342, 17.2654236774291, 17.0988006853227, 15.353091109001, 19.3008705114255, 6.27750073335289, 26.0375981018434, 17.2681438238026, 15.443279313632, 7.7125328659071, 30.1453193646502, 14.8701064405557, 24.7907034861927, 17.3296398891967, 10.7364199781261, 19.3800588668138, 10.3085483055134, 8.80185302168878, 16.6951761888471, 4.50797141286421, 6.84546862896979, 8.21845174973489, 6.19588744588745, 16.9889711436773, 5.59826387611726, 8.68694955964772, 3.65186966980101, 16.1123827476325, 9.67841682127396, 13.5423542354235, 5.6497484139138, 8.7686432740111, 11.9602529358627, 6.86294126054023, 19.2194992008524, 4.64579055441478, 9.5090599349543, 2.79913286437223, 10.2515243902439, 8.66738894907909, 3.6576768917803, 12.4953778763831, 15.2370770972205, 21.2257484260568, 7.8413206434768, 12.5950805097303, 6.23108480731724, 4.72859966550099, 3.11622388590868, 15.9319508257792, 6.69567319313512, 2.47749261819931, 24.8112304583644, 3.94306597422581, 2.71509876129896, 1.79760050991181, 4.80243967117475, 18.7818696883853, 5.24955116696589, 19.0728713579217, 12.6099706744868, 3.58964845561636, 11.3911041683795, 7.48350816481021, 15.0857882809971, 19.6855832458419, 12.2966073388367, 4.08228296275315, 21.4270750408514, 9.83262770545642, 6.28415300546448, 4.2754914877677, 10.4337099078042, 13.9745206313318, 14.0491684743312, 8.79131920024113, 15.2282010300124, 19.1379750063759, 6.89338235294118, 5.51527398074409, 18.3089033659066, 23.5368956743003, 10.3041872432253, 13.7563263088668, 12.0249520153551, 12.0066668763169, 9.25797503467406, 11.4912313643021, 14.2689601250977, 15.2254249815225, 14.0718562874251, 9.21820303383897, 9.9353894916494, 8.6011885743498, 14.7106815614409, 8.6682462336269, 10.9155102240965), IM = c(1.07456622007468, 1.05477685097601, 1.08970363580813, 1.09309079792113, 0.983952398124775, 0.97821952889272, 1.02464131763495, 0.913249100021176, 0.999321512574634, 1.00064160401003, 1.00311566921978, 1.03642655495856, 1.05350982751705, 1.03894736842105, 1.02694423605901, 1.0255795363709, 1.08604552865165, 0.9960092095165, 1.10034379028792, 1.05835010060362, 1.09069658719028, 1.08689655172414, 1.11247966534976, 1.06872703695699, 1.09098914000587, 0.947705442902882, 1.0462158808933, 1.06583294006607, 1.03178310316816, 1.02785822645152, 0.95582329317269, 1.03257159815996, 1.05732223283745, 1.05083088954057, 1.0375, 1.18054532056006, 1.08226897069872, 1.08357198646186, 1.11061739943873, 1.09309423884014, 1.14100039385585, 1.00222807372899, 1.02085106382979, 1.11658218682114, 1.08840413318025, 0.940623825629463, 1.07633027522936, 1.24954351795496, 1.06553284443751, 1.02449921811006, 1.03136617100372, 0.890711135611907, 1.01692767267131, 1.05692478931468, 1.00617965129111, 1.01988510826337, 1.02820400409177, 1.00325732899023, 0.969987048820317, 1.0319350473613, 0.948, 0.976430976430976, 0.912491945614184, 1.03805825242718, 1.01016333938294, 0.934502240405221, 0.936918076139056, 1.03298389158783, 1.06829657188414, 1.04918881601657, 1.0427807486631, 0.99369804237061, 1.00763125763126, 0.859808006713988, 1.06752246469833, 0.976588628762542, 0.900774538520513, 1.014353041988, 0.92939648374078, 0.934334930708457, 0.863916626564004, 1.00074278438031, 1.02873563218391, 0.882901764586573, 1.05623621661358, 1.09948152948801, 0.971704768125408, 1.0102470870176, 0.949198988195616, 0.999676323029616, 0.99394006170119, 1.02639721523883, 0.963297650493535, 1.02262711864407, 0.990626969124134, 1.02701607456437, 0.962433460076046, 1.05496997998666, 0.995055517002082, 0.99971081550029, 1.06194323596437, 1.0324851109908, 1.06694781233527, 1.01801801801802, 1.01774793140664, 1.01807723911257, 1.03578996939016, 1.00624427608026, 1.01527025469632, 0.990068754774637, 0.967759900990099, 0.954370905805286, 1.03321371306406, 1.01163888015099, 1.1162669447341, 0.998290598290598, 0.964776990412672, 1.00906196424198, 1.01454685890834, 1.04203511469947, 0.990833036667853, 1.02915422885572), altura = c(2, 4, 8, 200, 30, 25, 28, 50, 34, 2, 50, 100, 50, 125, 650, 75, 1550, 1165, 1200, 1700, 1850, 1200, 650, 1475, 1535, 2300, 1875, 850, 1550, 1675, 2550, 450, 980, 700, 1800, 25, 1300, 1625, 1250, 700, 75, 1800, 1925, 500, 2300, 1050, 2550, 1920, 1350, 2550, 1450, 2200, 550, 750, 950, 2475, 1975, 780, 1300, 1800, 1425, 1875, 1450, 1475, 1650, 1425, 125, 1150, 625, 2150, 1000, 2150, 1925, 1550, 1440, 2000, 1550, 18, 1775, 1550, 1575, 2120, 1800, 2150, 1600, 1900, 2125, 1000, 2050, 1550, 1800, 375, 1750, 2000, 1400, 2175, 2200, 1050, 1300, 1350, 2350, 150, 1250, 2150, 2500, 1325, 1250, 1800, 1100, 1800, 1800, 2000, 2125, 1750, 1550, 987.5, 1600, 2050, 1750, 1650, 2475, 1350), Region = structure(c(8, 8, 8, 8, 1, 8, 8, 1, 8, 8, 1, 1, 1, 1, 3, 8, 4, 4, 4, 4, 4, 5, 5, 4, 3, 4, 4, 5, 3, 4, 4, 5, 3, 3, 4, 8, 5, 5, 3, 5, 2, 4, 5, 5, 4, 3, 4, 5, 5, 4, 3, 4, 5, 5, 2, 4, 3, 5, 9, 7, 9, 6, 9, 3, 6, 9, 2, 5, 5, 6, 6, 6, 6, 9, 5, 6, 9, 8, 9, 9, 9, 6, 5, 6, 7, 7, 6, 6, 6, 7, 7, 2, 9, 7, 7, 6, 6, 6, 6, 7, 7, 2, 7, 6, 6, 7, 6, 7, 7, 7, 7, 7, 6, 6, 7, 7, 7, 7, 7, 6, 6, 7), .Label = c("BAJO CAUCA", "MAGDALENA MEDIO", "NORDESTE", "NORTE", "OCCIDENTE", "ORIENTE", "SUROESTE", "URABA", "VALLE DE ABURRA"), class = "factor"), Offset1 = c(-0.185125484126689, 0.118671529717499, 0.363948427905231, 0.241376319575269, -0.683196849706777, 1.30128098679293, 0.314810739840034, 0.986562784859487, 0.714908672341458, 1.54158724552593, 0.67141268841394, -0.122167633974208, 0.0411419433311752, 0.0344014267173323, 0.242161557149972, -0.608806032126194, 0.340748793388473, -0.551647618286246, -0.901402119380404, -0.763569644856491, -1.03282454813011, -1.03845836584836, -1.10563690360507, -1.06421086195078, -0.616186139423817, 0.508021696433256, -1.18417017702976, -1.04128722204884, -0.245900538436826, -0.473208760194684, -1.69826912614072, 0.131028262406404, -0.520875959619492, -0.16960278438618, -1.76609172247948, -2.21640739675299, -0.138113302129634, -1.18090753139494, -1.11474167059799, -0.711311151187616, -0.86988435906, -0.898942093539542, -1.48722027970985, -1.99510039324608, -1.22417551164346, -0.648173814917214, -1.48722027970985, -1.9241486572738, 0.188137942115395, 0.16296882827814, -0.233193887167711, -0.415515443961666, -0.139262067333508, -0.638658995275876, -0.97021907389971, -0.136965855073157, -0.512493680866688, -0.807436326962073, 0.436963775167535, -1.26584820804402, 0.392717535285662, -1.21739582465808, 2.50894864426824, -0.0693500781347932, -1.53247687129797, 0.718814927308523, 0.368801123736573, -0.398986142010455, -1.09961278900169, 0.0295588022415444, -0.162518929497775, 0.272314595320659, -1.20731170559145, 4.33235045310693, -1.09064411901893, -0.369615455214467, 2.04485009691022, -1.0106014113454, 0.580538236177291, 0.151002873536527, 1.57277392806251, 0.579978482454307, -1.17118298150295, 0.407463110770837, -0.269187489815617, -1.26940060964839, 1.20896034583698, 0.0207825391825284, -0.0693500781347932, -0.659712404473708, 0.441475545631197, -0.100925918589961, 0.789820067820206, 0.0797349680188535, 0.0168571170664228, -0.502526820951296, 0.56360780920496, -0.391562202939173, 0.0610950993598108, -0.612489277542491, -0.901402119380404, -0.62548853208613, -0.151986356997882, 0.630207380786071, -0.331285709933913, -1.09362474715707, -0.999672340813206, 0.0601539228197471, 0.459953293392234, -0.787457860031187, 0.29266961396282, -0.140412153716745, 0.268499253035007, -0.62548853208613, -0.610645959048202, -0.884307686021104, -0.136965855073157, -1.01335244471729, -0.372514007968479, -0.375420986759788, 0.745739630679116, 0.673964361143171)), .Names = c("MCHNV", "IA", "IM", "altura", "Region", "Offset1"), class = "data.frame", row.names = c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "100", "101", "102", "103", "104", "105", "106", "107", "108", "109", "110", "111", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121", "122")) model1J<-glm(MCHNV~offset(Offset1),data=testData,family="poisson") step(model1J,direction="forward", scope=(list(upper=~IA+IM+altura+Region+Region:IA+Region:IM+Region:altura+offset(Offset1), lower=~offset(Offset1)))) What am I doing wrong? ------------------------------------------------------------------------- Thank you for your help. I put here the database I use, so you can replicate the problem. (I am using R221 on WinXP)
On Thu, 23 Mar 2006, Kenneth Cabrera wrote:> What am I doing wrong?Not paying enough attention to the posting guide. Your example works in R-patched and R-devel, because of o factor.scope() could report incorrectly that interaction terms were not in the upper scope when such terms in the model and the upper scope had different orders for the main effects. (Another manifestation of PR#7842.) in the NEWS for R 2.2.1 patched. As the posting guide says If possible, try the current R-patched or R-devel version of R (see the FAQ for details), to see if the problem has already been addressed.> Ok> > Here is the complete command secuence > -------------------------------------------------------------------------- > > testData<-structure(list(MCHNV = c(215, 325, 435, 327, 150, 949, 417, 528, > 572, 1255, 517, 221, 306, 274, 307, 203, 258, 126, 88, 85, 75, > 64, 77, 49, 133, 192, 32, 73, 139, 52, 17, 307, 127, 182, 24, > 51, 141, 40, 76, 40, 100, 42, 18, 20, 18, 75, 26, 21, 216, 81, > 90, 69, 138, 79, 69, 52, 59, 69, 173, 29, 118, 23, 1456, 156, > 26, 208, 294, 84, 57, 84, 121, 112, 25, 9281, 36, 71, 812, 135, > 215, 94, 302, 148, 42, 84, 114, 54, 309, 148, 87, 75, 275, 171, > 210, 209, 150, 69, 157, 110, 93, 98, 40, 132, 155, 152, 62, 52, > 50, 124, 248, 52, 181, 76, 118, 73, 66, 65, 75, 33, 71, 84, 223, > 229), IA = c(26.9863956381346, 21.443816698054, 24.3172115328382, > 22.9861973271014, 18.1768608561301, 10.6563785744498, 15.0910419778194, > 13.6340158642317, 15.2055383362367, 16.9860295444068, 17.9909267660402, > 26.714962883463, 20.1507989217486, 27.4221304422647, 11.806433704469, > 25.7458563535912, 27.2816742408892, 26.0150722854506, 21.6368286445013, > 25.1843952723718, 18.6270125223614, 29.9515311742675, 26.2046204620462, > 12.6096949435855, 18.7464907355418, 10.5534246575342, 17.2654236774291, > 17.0988006853227, 15.353091109001, 19.3008705114255, 6.27750073335289, > 26.0375981018434, 17.2681438238026, 15.443279313632, 7.7125328659071, > 30.1453193646502, 14.8701064405557, 24.7907034861927, 17.3296398891967, > 10.7364199781261, 19.3800588668138, 10.3085483055134, 8.80185302168878, > 16.6951761888471, 4.50797141286421, 6.84546862896979, 8.21845174973489, > 6.19588744588745, 16.9889711436773, 5.59826387611726, 8.68694955964772, > 3.65186966980101, 16.1123827476325, 9.67841682127396, 13.5423542354235, > 5.6497484139138, 8.7686432740111, 11.9602529358627, 6.86294126054023, > 19.2194992008524, 4.64579055441478, 9.5090599349543, 2.79913286437223, > 10.2515243902439, 8.66738894907909, 3.6576768917803, 12.4953778763831, > 15.2370770972205, 21.2257484260568, 7.8413206434768, 12.5950805097303, > 6.23108480731724, 4.72859966550099, 3.11622388590868, 15.9319508257792, > 6.69567319313512, 2.47749261819931, 24.8112304583644, 3.94306597422581, > 2.71509876129896, 1.79760050991181, 4.80243967117475, 18.7818696883853, > 5.24955116696589, 19.0728713579217, 12.6099706744868, 3.58964845561636, > 11.3911041683795, 7.48350816481021, 15.0857882809971, 19.6855832458419, > 12.2966073388367, 4.08228296275315, 21.4270750408514, 9.83262770545642, > 6.28415300546448, 4.2754914877677, 10.4337099078042, 13.9745206313318, > 14.0491684743312, 8.79131920024113, 15.2282010300124, 19.1379750063759, > 6.89338235294118, 5.51527398074409, 18.3089033659066, 23.5368956743003, > 10.3041872432253, 13.7563263088668, 12.0249520153551, 12.0066668763169, > 9.25797503467406, 11.4912313643021, 14.2689601250977, 15.2254249815225, > 14.0718562874251, 9.21820303383897, 9.9353894916494, 8.6011885743498, > 14.7106815614409, 8.6682462336269, 10.9155102240965), IM > c(1.07456622007468, > 1.05477685097601, 1.08970363580813, 1.09309079792113, 0.983952398124775, > 0.97821952889272, 1.02464131763495, 0.913249100021176, 0.999321512574634, > 1.00064160401003, 1.00311566921978, 1.03642655495856, 1.05350982751705, > 1.03894736842105, 1.02694423605901, 1.0255795363709, 1.08604552865165, > 0.9960092095165, 1.10034379028792, 1.05835010060362, 1.09069658719028, > 1.08689655172414, 1.11247966534976, 1.06872703695699, 1.09098914000587, > 0.947705442902882, 1.0462158808933, 1.06583294006607, 1.03178310316816, > 1.02785822645152, 0.95582329317269, 1.03257159815996, 1.05732223283745, > 1.05083088954057, 1.0375, 1.18054532056006, 1.08226897069872, > 1.08357198646186, 1.11061739943873, 1.09309423884014, 1.14100039385585, > 1.00222807372899, 1.02085106382979, 1.11658218682114, 1.08840413318025, > 0.940623825629463, 1.07633027522936, 1.24954351795496, 1.06553284443751, > 1.02449921811006, 1.03136617100372, 0.890711135611907, 1.01692767267131, > 1.05692478931468, 1.00617965129111, 1.01988510826337, 1.02820400409177, > 1.00325732899023, 0.969987048820317, 1.0319350473613, 0.948, > 0.976430976430976, 0.912491945614184, 1.03805825242718, 1.01016333938294, > 0.934502240405221, 0.936918076139056, 1.03298389158783, 1.06829657188414, > 1.04918881601657, 1.0427807486631, 0.99369804237061, 1.00763125763126, > 0.859808006713988, 1.06752246469833, 0.976588628762542, 0.900774538520513, > 1.014353041988, 0.92939648374078, 0.934334930708457, 0.863916626564004, > 1.00074278438031, 1.02873563218391, 0.882901764586573, 1.05623621661358, > 1.09948152948801, 0.971704768125408, 1.0102470870176, 0.949198988195616, > 0.999676323029616, 0.99394006170119, 1.02639721523883, 0.963297650493535, > 1.02262711864407, 0.990626969124134, 1.02701607456437, 0.962433460076046, > 1.05496997998666, 0.995055517002082, 0.99971081550029, 1.06194323596437, > 1.0324851109908, 1.06694781233527, 1.01801801801802, 1.01774793140664, > 1.01807723911257, 1.03578996939016, 1.00624427608026, 1.01527025469632, > 0.990068754774637, 0.967759900990099, 0.954370905805286, 1.03321371306406, > 1.01163888015099, 1.1162669447341, 0.998290598290598, 0.964776990412672, > 1.00906196424198, 1.01454685890834, 1.04203511469947, 0.990833036667853, > 1.02915422885572), altura = c(2, 4, 8, 200, 30, 25, 28, 50, 34, > 2, 50, 100, 50, 125, 650, 75, 1550, 1165, 1200, 1700, 1850, 1200, > 650, 1475, 1535, 2300, 1875, 850, 1550, 1675, 2550, 450, 980, > 700, 1800, 25, 1300, 1625, 1250, 700, 75, 1800, 1925, 500, 2300, > 1050, 2550, 1920, 1350, 2550, 1450, 2200, 550, 750, 950, 2475, > 1975, 780, 1300, 1800, 1425, 1875, 1450, 1475, 1650, 1425, 125, > 1150, 625, 2150, 1000, 2150, 1925, 1550, 1440, 2000, 1550, 18, > 1775, 1550, 1575, 2120, 1800, 2150, 1600, 1900, 2125, 1000, 2050, > 1550, 1800, 375, 1750, 2000, 1400, 2175, 2200, 1050, 1300, 1350, > 2350, 150, 1250, 2150, 2500, 1325, 1250, 1800, 1100, 1800, 1800, > 2000, 2125, 1750, 1550, 987.5, 1600, 2050, 1750, 1650, 2475, > 1350), Region = structure(c(8, 8, 8, 8, 1, 8, 8, 1, 8, 8, 1, > 1, 1, 1, 3, 8, 4, 4, 4, 4, 4, 5, 5, 4, 3, 4, 4, 5, 3, 4, 4, 5, > 3, 3, 4, 8, 5, 5, 3, 5, 2, 4, 5, 5, 4, 3, 4, 5, 5, 4, 3, 4, 5, > 5, 2, 4, 3, 5, 9, 7, 9, 6, 9, 3, 6, 9, 2, 5, 5, 6, 6, 6, 6, 9, > 5, 6, 9, 8, 9, 9, 9, 6, 5, 6, 7, 7, 6, 6, 6, 7, 7, 2, 9, 7, 7, > 6, 6, 6, 6, 7, 7, 2, 7, 6, 6, 7, 6, 7, 7, 7, 7, 7, 6, 6, 7, 7, > 7, 7, 7, 6, 6, 7), .Label = c("BAJO CAUCA", "MAGDALENA MEDIO", > "NORDESTE", "NORTE", "OCCIDENTE", "ORIENTE", "SUROESTE", "URABA", > "VALLE DE ABURRA"), class = "factor"), Offset1 = c(-0.185125484126689, > 0.118671529717499, 0.363948427905231, 0.241376319575269, > -0.683196849706777, > 1.30128098679293, 0.314810739840034, 0.986562784859487, 0.714908672341458, > 1.54158724552593, 0.67141268841394, -0.122167633974208, 0.0411419433311752, > 0.0344014267173323, 0.242161557149972, -0.608806032126194, > 0.340748793388473, > -0.551647618286246, -0.901402119380404, -0.763569644856491, > -1.03282454813011, > -1.03845836584836, -1.10563690360507, -1.06421086195078, > -0.616186139423817, > 0.508021696433256, -1.18417017702976, -1.04128722204884, > -0.245900538436826, > -0.473208760194684, -1.69826912614072, 0.131028262406404, > -0.520875959619492, > -0.16960278438618, -1.76609172247948, -2.21640739675299, > -0.138113302129634, > -1.18090753139494, -1.11474167059799, -0.711311151187616, -0.86988435906, > -0.898942093539542, -1.48722027970985, -1.99510039324608, > -1.22417551164346, > -0.648173814917214, -1.48722027970985, -1.9241486572738, 0.188137942115395, > 0.16296882827814, -0.233193887167711, -0.415515443961666, > -0.139262067333508, > -0.638658995275876, -0.97021907389971, -0.136965855073157, > -0.512493680866688, > -0.807436326962073, 0.436963775167535, -1.26584820804402, > 0.392717535285662, > -1.21739582465808, 2.50894864426824, -0.0693500781347932, > -1.53247687129797, > 0.718814927308523, 0.368801123736573, -0.398986142010455, > -1.09961278900169, > 0.0295588022415444, -0.162518929497775, 0.272314595320659, > -1.20731170559145, > 4.33235045310693, -1.09064411901893, -0.369615455214467, 2.04485009691022, > -1.0106014113454, 0.580538236177291, 0.151002873536527, 1.57277392806251, > 0.579978482454307, -1.17118298150295, 0.407463110770837, > -0.269187489815617, > -1.26940060964839, 1.20896034583698, 0.0207825391825284, > -0.0693500781347932, > -0.659712404473708, 0.441475545631197, -0.100925918589961, > 0.789820067820206, > 0.0797349680188535, 0.0168571170664228, -0.502526820951296, > 0.56360780920496, > -0.391562202939173, 0.0610950993598108, -0.612489277542491, > -0.901402119380404, > -0.62548853208613, -0.151986356997882, 0.630207380786071, > -0.331285709933913, > -1.09362474715707, -0.999672340813206, 0.0601539228197471, > 0.459953293392234, > -0.787457860031187, 0.29266961396282, -0.140412153716745, > 0.268499253035007, > -0.62548853208613, -0.610645959048202, -0.884307686021104, > -0.136965855073157, > -1.01335244471729, -0.372514007968479, -0.375420986759788, > 0.745739630679116, > 0.673964361143171)), .Names = c("MCHNV", "IA", "IM", "altura", > "Region", "Offset1"), class = "data.frame", row.names = c("1", > "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", > "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", > "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", > "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", > "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", > "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", > "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", > "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", > "91", "92", "93", "94", "95", "96", "97", "98", "99", "100", > "101", "102", "103", "104", "105", "106", "107", "108", "109", > "110", "111", "112", "113", "114", "115", "116", "117", "118", > "119", "120", "121", "122")) > model1J<-glm(MCHNV~offset(Offset1),data=testData,family="poisson") > step(model1J,direction="forward", > scope=(list(upper=~IA+IM+altura+Region+Region:IA+Region:IM+Region:altura+offset(Offset1), > lower=~offset(Offset1)))) > What am I doing wrong? > > ------------------------------------------------------------------------- > Thank you for your help. > > I put here the database I use, so you can replicate the problem. > (I am using R221 on WinXP) > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595