[R-sig-ME] Probability of Independence in lmer with categorical variables
Stefanie LaZerte
steffi.lazerte at mail.mcgill.ca
Fri Oct 2 01:15:37 CEST 2009
Hi,
I've been reading through this list's archives for the better part of a
year and have always managed to find the solution to my problems.
However, this time I'm stumped.
I'm performing a path analysis (structural equation model) using the
d-separation technique developed by Bill Shipley. What it boils down to
is many tests of independence between different variables while
controlling for other variables in the model. The numeric results of
these tests of independence (namely, the p-values) are then combined in
a statistic that tests the fit of the model as a whole.
Right now I'm having problems getting a value of the probability of
independence between variables when one is categorical. The lmer
function calculates the estimates and probabilities for each level of
the variable I'm interested in, instead of the variable as a whole.
Since lmer doesn't have support for the anova() function, I cannot
determine the probability of each factor that way, either.
I was wondering if anyone was aware of a way to determine the overall
probability of independence for a categorical variable in lmer? I'm
pretty sure that the anova table question has been asked to death, but
if there's another way, or a manual way, of calculating it, I'd be much
obliged!
Thanks for any help or advice,
Stefanie LaZerte
For clarity, below is the example I'm having trouble with:
For the activity of chipmunks measured each day and each night for each
individual over a period of 3 months
day = continuous, activity throughout the day
night = binary, 0/1, activity at night
sex = binary, F/M
seasons = categorical (5 levels)
ID = individual ID
Here I want the probability of night being independent from seasons
while controlling for day and seasons:sex and controlling in a
mixed-model way for the repeated measures on individuals. Bear in mind
that this is a nonesense model in that I'm simply using it to derive the
independence between variables.
m=lmer(night~day+seasons:sex+seasons+(1|ID), data=data,
na.action=na.omit,family=binomial)
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.65001 0.79877 -3.318 0.000908 ***
day 5.88333 1.25466 4.689 2.74e-06 ***
seasonsLull 2.12974 1.01252 2.103 0.035431 *
seasonsEnd Lull 1.47929 0.89018 1.662 0.096556 .
seasonspost lull 1.85385 0.83792 2.212 0.026936 *
seasonsPost-post lull 0.96935 0.87141 1.112 0.265968
seasonsStart Lull:sexF 0.47920 0.95042 0.504 0.614120
seasonsLull:sexF -0.22464 0.89293 -0.252 0.801368
seasonsEnd Lull:sexF -0.17084 0.65332 -0.261 0.793714
seasonspost lull:sexF 0.16982 0.47757 0.356 0.722146
seasonsPost-post lull:sexF -0.08716 0.73669 -0.118 0.905816
More information about the R-sig-mixed-models
mailing list