John Clark
2011-Feb-20 01:58 UTC
[R] loop with model fitting pair of consecutive pair of variable: mailing all of you because it was last option
Dear R-users and experts I want to create to analyse my data which looks like follows:( I have show only 8 variables but original variables much more number >1000) *sub* *ydata* *X1* *X2* *X3* *X4* *X5* *X6* *X7* *X8* 1 12 1 1 1 2 1 1 1 1 2 13 2 2 1 2 2 1 1 1 3 11 1 1 1 2 1 2 1 2 4 12 1 1 2 1 1 2 2 2 5 14 1 2 2 1 1 2 2 2 6 12 2 1 1 2 2 1 1 1 7 8 2 2 2 2 1 1 2 1 8 19 1 1 1 1 1 2 2 1 9 6 2 2 2 1 1 1 1 2 I want to create look to fit models like the following: lme(ydata ~ X1+ X2, random= intercept) lme(ydata ~ X3+X4, random= intercept) lme(ydata ~ X5+ X6, random= intercept) lme(ydata ~ X7 + X8, random= intercept) means that the loop should read all the X variables in files, but I do not want to avoid litting lme(ydata ~ X2+ X3) or lme(ydata ~ X4+X5) or lme(ydata ~ X6+X7). Also I want only output the P value to a vector so that I can plot the graph with X versus P value. I have hard time with picking lme output to a vector. If it is impossible please just suggest in term of linear model (lm), in this type I had no option than adopt the lm nor lme. I am sorry to bother you all but it only option remaining ! Thanks; John [[alternative HTML version deleted]]
Apparently Analagous Threads
- Prediction with two fixed-effects - large number of IDs
- Prediction with two fixed-effects - large number of IDs
- Non-linear Regression : Error in eval(expr, envir, enclos)
- Ad: Re: Ad: Re: R crashes for large formulas in lm() (PR#8180)
- Ad: Re: R crashes for large formulas in lm() (PR#8180)