[R-sig-ME] mcmcsamp in lme4
Ben Bolker
bolker at ufl.edu
Wed Jun 10 00:18:33 CEST 2009
There is indeed a simulate.lme() function in nlme:
can you use this to construct a Monte Carlo simulation?
i.e. (pseudocode)
fit full model (model1)
fit appropriate reduced model (model0)
N times (using replicate() or a for loop) {
simulate from reduced model, using simulate.lme(model0);
pack it back into a copy of the original data frame
fit full model [in lme4 there is a "refit" method that is
more efficient, but apparently not in nlme]
to simulated (null data)
fit reduced model (minus one or more fixed terms), ditto
compute/save deviance difference between full and reduced model
as results[i]
}
compare observed deviance difference to simulated distribution:
mean(c(results,obsdev)>=obsdev)
cheers
Ben
De Smedt Sebastiaan wrote:
> I fitted a mixed-effects model with a Variance Structure in nlme
> (because Variance Structures are not yet implemented in lme4). After
> several model fittings (with method="ML"), I found the optimal fixed
> structure of my explanatory variables.
>
> I understood from this mailing list that the p-values of the fixed
> effects, given by summary(namemodel) are not trustable and thus I want
> to use a Monte Carlo simulation in order to estimate the significance of
> the fixed terms. This command doesn't exist in nlme, and I can't fit my
> model in lme4. Is there a way to overcome this problem? Or another
> function in nlme that gives comparable results?
>
>
>
>
>
> Thanks a lot,
>
> Sebastiaan
>
>
>
> Sebastiaan De Smedt
>
> Research assistant
>
> UA - Department of Bioscience Engineering
>
>
>
> Groenenborgerlaan 171 - V6.16
>
> B-2020 Antwerpen, Belgium
>
> +32 (0)3 265 34 51
>
>
>
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
--
Ben Bolker
Associate professor, Biology Dep't, Univ. of Florida
bolker at ufl.edu / www.zoology.ufl.edu/bolker
GPG key: www.zoology.ufl.edu/bolker/benbolker-publickey.asc
More information about the R-sig-mixed-models
mailing list