[R-sig-ME] suggestions for estimating confidence intervals with only 1.5 GB of ram?
Andrew Miles
rstuff.miles at gmail.com
Fri Apr 1 02:22:36 CEST 2011
I believe what David was pointing out was that your random effect for
yearMonth has a variance of 0.000000. That suggests to me that there
is no yearMonth level variation for your model to explain - i.e. you
don't need to use a mixed model but can use OLS or GLM.
As for the autocorrelation, have you checked your data for
autocorrelation using a test like the Durban-Watson test (dwtest
{lmtest})? If so and it is a problem, you might want to use an OLS or
GLM model with corrected standard errors, which can be found in the
sandwich package (vcovHAC function).
If you want confidence intervals and have some time to kill,
bootstrapping is probably a pretty good approach.
Andrew Miles
On Mar 31, 2011, at 8:07 PM, Darren Norris wrote:
> Many thanks for the reply David,
> I am probably being thick - but it is not the estimates for random
> effects that I am interested in.....
> I am trying to get the confidence intervals around the predicted
> values from the fixed effects.
>
> for example:
> The data is available at this link as a R workspace
> "DarrensSpace.RData" (size is approx 70 kb):
> http://cid-f0a9fa3480208398.office.live.com/self.aspx/lmeData/DarrensSpace.RData
>
> #### the random effect (1|yearMonth) is used to model serial
> temporal autocorrelation,
> #### data is observational & ecological so unbalanced
> #### "yall " is abundance of the turtle species of interest
> library("lme4")
> fmer2f<-lmer(yall~yearSeason+sun+total_precip_trip+mean_temp_trip
> +surveyArea+obscat+hour_period+(1|yearMonth),REML=FALSE,data=df.p)
>
> library(AICcmodavg) # another very helpful library
> p.fmer2f<-predictSE.mer(fmer2f, df.p,type="response")
>
> #### I can then plot and see predicted values and SE if I wanted,
> for example....
> plot(df.p$yall) #observed values
> lines(p.fmer2f$fit) #predicted response
>
> How can I calculate / approximate 95 CI intervals to go around this
> line?
>
> Many thanks again!
> Darrren
>
>
>
> -----Original Message----- From: David Duffy
> Sent: Thursday, March 31, 2011 8:42 PM
> To: Darren Norris
> Cc: r-sig-mixed-models at r-project.org
> Subject: Re: [R-sig-ME] suggestions for estimating confidence
> intervals with only 1.5 GB of ram?
>
> On Thu, 31 Mar 2011, Darren Norris wrote:
>
>> I would like to obtain (then plot) the fitted (?predicted - sorry
>> never know correct term) response values and in an ideal world 95%
>> confidence (or prediction) intervals for a lmer model.
>
> Possibly I'm being obtuse, but in your fmer2f model has
>
> Random effects:
> Groups Name Variance Std.Dev.
> yearMonth (Intercept) 0.000000 0.00000 <----
> Residual 0.096815 0.31115
> Number of obs: 333, groups: yearMonth, 50
>
> Cheers, David Duffy.
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
More information about the R-sig-mixed-models
mailing list