Tanu Soni
2011-Nov-17 15:22 UTC
[R] lme contrast Error in `$<-.data.frame`(`*tmp*`, "df", value = numeric(0)) :
I am trying to run a lme model and some contrast for a matrix . lnY [1] 10.911628 11.198557 11.316971 11.464869 11.575233 11.612101 11.755903 11.722035 11.757705 11.863744 11.846515 11.852721 11.866936 11.838452 11.946680 11.885509 [17] 11.583309 11.750082 11.756005 11.630797 11.705536 11.566722 11.679448 11.703521 NA 11.570949 11.716919 11.573343 11.733770 11.720801 11.804124 11.775074 [33] 11.801669 11.856955 11.875859 11.851852 11.830149 11.920156 11.954247 11.880917 11.806162 7.823646 11.909182 NA NA 11.912386 12.048816 11.958284 [49] 11.929021 11.986062 11.968418 11.967999 11.911608 plate [1] 2 1 2 2 1 1 1 2 2 1 2 1 3 3 3 3 3 3 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 9 Levels: 1 2 3 4 5 6 7 8 9> gb[1] tSac tSac tAceK tAceK cDMSO cDMSO tAceK tSac cDMSO tAceK cDMSO tSac cDMSO cDMSO tSac tSac tAceK tAceK tSac cDMSO tSac tAceK cDMSO tAceK tSac cDMSO tAceK cDMSO [29] tAceK tSac cDMSO cDMSO tSac tAceK tSac tAceK tSac tAceK cDMSO cDMSO tAceK tSac tAceK tSac cDMSO tAceK tSac tSac cDMSO tAceK tSac tAceK cDMSO Levels: cDMSO tAceK tSac> time[1] 1hr 1hr 1hr 1hr 1hr 1hr 1hr 1hr 1hr 1hr 1hr 1hr 1hr 1hr 1hr 1hr 1hr 1hr 4hr 4hr 4hr 4hr 4hr 4hr 4hr 4hr 4hr 4hr 4hr 4hr 4hr 4hr 4hr 4hr 4hr 4hr 15m 15m 15m 15m 15m 15m [43] 15m 15m 15m 15m 15m 15m 15m 15m 15m 15m 15m Levels: 15m 1hr 4hr metab2<-data.frame(plate,lnY,gb,time) fm1<-lme(lnY ~ time*gb,random=~1|plate,metab2,na.action=na.omit) t1<-contrast(fm1,a = list(gb ="cDMSO" ,time="15m" ),b = list(gb "tAceK",time="15m")) t2<-contrast(fm1,a = list(gb ="cDMSO" ,time="15m" ),b = list(gb "tSac",time="15m")) I am doing similar contrasts in 1hr and 4hr time result: t1 lme model parameter contrast Contrast S.E. Lower Upper t df Pr(>|t|) 0.01466447 0.3880718 -0.7459424 0.7752713 0.04 39 0.97> t2lme model parameter contrast Contrast S.E. Lower Upper t df Pr(>|t|) 0.8007098 0.401809 0.01317859 1.588241 1.99 39 0.0533 but it doesnt work when my lnY is>lnY [1] 14.08164 14.03683 15.23784 14.86681 15.69648 15.62681 15.38057 13.79152 15.59356 15.26301 15.49928 14.02714 15.54317 15.44776 14.51406 14.26436 14.76043 15.01506 [19] 13.75356 15.36528 13.86303 14.40074 15.39995 14.34945 14.32001 15.41146 14.43210 15.87487 14.31152 13.75980 15.44153 15.72775 13.83677 14.35888 14.08998 14.40057 [37] 15.25646 15.21430 15.21883 15.09338 15.24249 15.15223 15.19692 15.10101 15.16232 15.81154 15.30002 15.31443 15.25059 15.10284 15.38775 15.28618 15.38108 I am able to fit the model i.e i am getting my fm1> t1lme model parameter contrast Error in `$<-.data.frame`(`*tmp*`, "df", value = numeric(0)) : replacement has 0 rows, data has 1 [[alternative HTML version deleted]]
rahulprabhuh
2011-Nov-23 14:48 UTC
[R] lme contrast Error in `$<-.data.frame`(`*tmp*`, "df", value = numeric(0)) :
I had the same problem while doing classification using rpart. The mistake I had made was that the column names in the data frames had spaces and other special characters. I got the output when I changed this. Hope this helps. -- View this message in context: http://r.789695.n4.nabble.com/lme-contrast-Error-in-data-frame-tmp-df-value-numeric-0-tp4081333p4099895.html Sent from the R help mailing list archive at Nabble.com.