toby909 at gmail.com
2007-Jun-01 18:14 UTC
[R] how to specify starting values in varIdent() of lme()
I was reading the help but just did not get how to specify starting values for varIdent() of the lme() function, although I managed to do it for corSymm(). Do I specify the values just as they are printed out in an output, like c(1, 1.3473, 1.0195). Or do I need to take the residual and multiply it with these like c(0.2235, 0.2235*1.3473, 0.2235*1.0195) or any other form that I dont know of? Thanks Toby Linear mixed-effects model fit by REML Data: dtaa AIC BIC logLik -788.783 -692.5656 409.3915 Random effects: Formula: ~timef - 1 | orgid Structure: General positive-definite, Log-Cholesky parametrization StdDev Corr timef1 0.04398482 timef1 timef2 timef2 0.07910354 1 timef3 0.03648411 1 1 Residual 0.22350583 Correlation Structure: General Formula: ~1 | orgid/id Parameter estimate(s): Correlation: 1 2 2 0.487 3 0.597 0.440 Variance function: Structure: Different standard deviations per stratum Formula: ~1 | time Parameter estimates: 1 2 3 1.000000 1.347341 1.019529 Fixed effects: score ~ timef - 1 Value Std.Error DF t-value p-value timef1 -0.3846847 0.007627811 4421 -50.43186 0 timef2 -0.2727646 0.012012786 4421 -22.70619 0 timef3 -0.3961244 0.007180147 4421 -55.16939 0 Correlation: timef1 timef2 timef2 0.735 timef3 0.746 0.670 Standardized Within-Group Residuals: Min Q1 Med Q3 Max -1.4659548 -0.5982929 -0.4096429 0.3101507 4.0911728 Number of Observations: 4515 Number of Groups: 92
Douglas Bates
2007-Jun-01 20:10 UTC
[R] how to specify starting values in varIdent() of lme()
On 6/1/07, toby909 at gmail.com <toby909 at gmail.com> wrote:> I was reading the help but just did not get how to specify starting values for > varIdent() of the lme() function, although I managed to do it for corSymm().> Do I specify the values just as they are printed out in an output, like c(1, > 1.3473, 1.0195). Or do I need to take the residual and multiply it with these > like c(0.2235, 0.2235*1.3473, 0.2235*1.0195) > or any other form that I dont know of?Strangely enough you specify it in the form described in ?varIdent Look at the description of the value argument.> > Thanks Toby > > > > > > Linear mixed-effects model fit by REML > Data: dtaa > AIC BIC logLik > -788.783 -692.5656 409.3915 > > Random effects: > Formula: ~timef - 1 | orgid > Structure: General positive-definite, Log-Cholesky parametrization > StdDev Corr > timef1 0.04398482 timef1 timef2 > timef2 0.07910354 1 > timef3 0.03648411 1 1 > Residual 0.22350583 > > Correlation Structure: General > Formula: ~1 | orgid/id > Parameter estimate(s): > Correlation: > 1 2 > 2 0.487 > 3 0.597 0.440 > Variance function: > Structure: Different standard deviations per stratum > Formula: ~1 | time > Parameter estimates: > 1 2 3 > 1.000000 1.347341 1.019529 > Fixed effects: score ~ timef - 1 > Value Std.Error DF t-value p-value > timef1 -0.3846847 0.007627811 4421 -50.43186 0 > timef2 -0.2727646 0.012012786 4421 -22.70619 0 > timef3 -0.3961244 0.007180147 4421 -55.16939 0 > Correlation: > timef1 timef2 > timef2 0.735 > timef3 0.746 0.670 > > Standardized Within-Group Residuals: > Min Q1 Med Q3 Max > -1.4659548 -0.5982929 -0.4096429 0.3101507 4.0911728 > > Number of Observations: 4515 > Number of Groups: 92 > > ______________________________________________ > 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 > and provide commented, minimal, self-contained, reproducible code. >
toby909 at gmail.com
2007-Jun-04 19:30 UTC
[R] how to specify starting values in varIdent() of lme()
Douglas Bates wrote:> On 6/1/07, toby909 at gmail.com <toby909 at gmail.com> wrote: > >>I was reading the help but just did not get how to specify starting values for >>varIdent() of the lme() function, although I managed to do it for corSymm(). > > >>Do I specify the values just as they are printed out in an output, like c(1, >>1.3473, 1.0195). Or do I need to take the residual and multiply it with these >>like c(0.2235, 0.2235*1.3473, 0.2235*1.0195) >>or any other form that I dont know of? > > > Strangely enough you specify it in the form described in > > ?varIdent > > Look at the description of the value argument. >Now the list knows how to find the help of the varIdent function. For my situation, I think R does not like expressions like 2=1.94..., "2" supposed to serve as label.... summary(m3 <- lme(score~timef-1, dtaa, ~timef-1|orgid, corSymm(svc,~1|orgid/id), varIdent(c(1.94,1.05),~1|time),,,na.omit,lmeControl(1000,1000,,,2000,,,1,1))) Error in varIdent(c(1.94, 1.05), ~1 | time) : Initial values must have group names in varIdent summary(m3 <- lme(score~timef-1, dtaa, ~timef-1|orgid, corSymm(svc,~1|orgid/id), varIdent(c(2=1.94,3=1.05),~1|time),,,na.omit,lmeControl(1000,1000,,,2000,,,1,1))) Error: syntax error in "summary(m3 <- lme(score~timef-1, dtaa, ~timef-1|orgid, corSymm(svc,~1|orgid/id), varIdent(c(2=" Without starting values: Linear mixed-effects model fit by REML Data: dtaa AIC BIC logLik -697.0142 -601.366 363.5071 Random effects: Formula: ~timef - 1 | orgid Structure: General positive-definite, Log-Cholesky parametrization StdDev Corr timef1 0.02974621 timef1 timef2 timef2 0.05790348 0.923 timef3 0.03745570 0.921 0.999 Residual 0.22385809 Correlation Structure: General Formula: ~1 | orgid/id Parameter estimate(s): Correlation: 1 2 2 0.503 3 0.578 0.475 Variance function: Structure: Different standard deviations per stratum Formula: ~1 | time Parameter estimates: 1 2 3 1.000000 1.411556 1.002088 Fixed effects: score ~ timef - 1 Value Std.Error DF t-value p-value timef1 -0.3813594 0.006800189 4253 -56.08070 0 timef2 -0.2551952 0.010747688 4253 -23.74419 0 timef3 -0.3939206 0.007296932 4253 -53.98441 0 Correlation: timef1 timef2 timef2 0.625 timef3 0.675 0.666 Standardized Within-Group Residuals: Min Q1 Med Q3 Max -1.1898841 -0.5756576 -0.4576534 0.2810892 4.1498533 Number of Observations: 4347 Number of Groups: 92> >>Thanks Toby >> >> >> >> >> >>Linear mixed-effects model fit by REML >> Data: dtaa >> AIC BIC logLik >> -788.783 -692.5656 409.3915 >> >>Random effects: >> Formula: ~timef - 1 | orgid >> Structure: General positive-definite, Log-Cholesky parametrization >> StdDev Corr >>timef1 0.04398482 timef1 timef2 >>timef2 0.07910354 1 >>timef3 0.03648411 1 1 >>Residual 0.22350583 >> >>Correlation Structure: General >> Formula: ~1 | orgid/id >> Parameter estimate(s): >> Correlation: >> 1 2 >>2 0.487 >>3 0.597 0.440 >>Variance function: >> Structure: Different standard deviations per stratum >> Formula: ~1 | time >> Parameter estimates: >> 1 2 3 >>1.000000 1.347341 1.019529 >>Fixed effects: score ~ timef - 1 >> Value Std.Error DF t-value p-value >>timef1 -0.3846847 0.007627811 4421 -50.43186 0 >>timef2 -0.2727646 0.012012786 4421 -22.70619 0 >>timef3 -0.3961244 0.007180147 4421 -55.16939 0 >> Correlation: >> timef1 timef2 >>timef2 0.735 >>timef3 0.746 0.670 >> >>Standardized Within-Group Residuals: >> Min Q1 Med Q3 Max >>-1.4659548 -0.5982929 -0.4096429 0.3101507 4.0911728 >> >>Number of Observations: 4515 >>Number of Groups: 92 >> >>______________________________________________ >>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 >>and provide commented, minimal, self-contained, reproducible code. >> > > > ______________________________________________ > 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 > and provide commented, minimal, self-contained, reproducible code. >