Displaying 1 result from an estimated 1 matches for "eg1gd".
Did you mean:
eg115
2008 Jun 04
2
Constructing groupedData objects in nlme - a little problem
Dear R-help,
I am trying to create groupedData objects using the nlme library. I'm
missing something basic, I know:
Here is the first example in ch.1 of Pinheiro & Bates (2000):
library(nlme)
x2=Rail$travel;x1=Rail$Rail;eg1=data.frame(x1,x2);eg1gd=Rail
print(eg1gd)
x11();print(plot(eg1gd))
femodel=lm(x2~x1-1,data=eg1gd)
print(femodel$coefficients)
Result:
x12 x15 x11 x16 x13 x14
31.66667 50.00000 54.00000 82.66667 84.66667 96.00000
...which works fine. This uses a built-in groupedData object called "...