

Dear all,
I am running this model

lmer1d_2 <- lmer(vathmos ~ adj.v.excused  * subject2  +  adj.v.unexcused  * subject2  +  ETHNICITY  +  adj.v.apovoli *  ETHNICITY     + SCHOOL  + GENDER +  PARENTALEDUCATIONALLEVEL2 + PARENTALOCCUPATIONALLEVEL2 + (1  |AR.MITROU),  data= all_v3 )
print(lmer1d_2, cor=F)

I get those results which show that none of the coefficients of the levels of the interaction are statistically significantly different from zero:

Fixed effects:
                                                          Estimate Std. Error t value
(Intercept)                                                13.25046    0.29645   44.70
ETHNICITYGeorgian:adj.v.apovoli                             0.12467    0.07181    1.74
ETHNICITYOther:adj.v.apovoli                                0.04818    0.05384    0.89



If I try anova(lmer1d_2) then the interaction [adj.v.apovoli *  ETHNICITY] is not statistically significant
Analysis of Variance Table
                           Df  Sum Sq Mean Sq  F value
ETHNICITY:adj.v.apovoli     2    6.67    3.33   1.7094



*However*, if I remove the interaction term, rerun the model and use  anova(lmer1d_2, lmer1d_3), I get this:
         Df   AIC   BIC logLik  Chisq Chi Df Pr(>Chisq)   
lmer1d_3 27 32213 32401 -16080                            
lmer1d_2 30 32205 32413 -16072 14.643      3   0.002148 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 



which suggests that it is better to run the model INCLUDING the interaction term.


Am I missing something here, could anyone please help?

Thank you 


Jason

 
Dr. Iasonas Lamprianou
Department of Social and Political Sciences
University of Cyprus


>________________________________
> From: "r-sig-mixed-models-request@r-project.org" <r-sig-mixed-models-request@r-project.org>
>To: r-sig-mixed-models@r-project.org 
>Sent: Wednesday, 17 April 2013, 13:00
>Subject: R-sig-mixed-models Digest, Vol 76, Issue 20
> 
>
>Send R-sig-mixed-models mailing list submissions to
>    r-sig-mixed-models@r-project.org
>
>To subscribe or unsubscribe via the World Wide Web, visit
>    https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>or, via email, send a message with subject or body 'help' to
>    r-sig-mixed-models-request@r-project.org
>
>You can reach the person managing the list at
>    r-sig-mixed-models-owner@r-project.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of R-sig-mixed-models digest..."
>
>
>Today's Topics:
>
>   1. Residuals in lmer and glmmADMB (Elinor McGrath)
>   2. Question about Multilevel ZIP model with glmmADMB
>      (Nicolas Gavoille)
>   3. lme4 crossed random effects predictions (Philip Harrison)
>   4. Cross-level interaction must include constitutive terms of
>      interactions in the following code? (Richard Asturia)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Mon, 15 Apr 2013 16:38:14 -0700
>From: Elinor McGrath <elinorjochum@hotmail.com>
>To: "r-sig-mixed-models@r-project.org"
>    <r-sig-mixed-models@r-project.org>
>Subject: [R-sig-ME] Residuals in lmer and glmmADMB
>Message-ID: <BLU174-W28081614EDC674AD913D7ECACC0@phx.gbl>
>Content-Type: text/plain
>
>This is a response to the thread by Adam Smith posted on November-15-12 about lmer (lme4) and glmmADMB generating very different residuals but identical or similar estimates of fixed and random effects. The response was that it was fixed in glmmADMB version 0.7.3. 
>
>I have now installed glmmADMB version 0.7.4 and R version 3.0.0, but still seem to get vastly different residuals for what appear to be identical models in lmer and glmmADMB.
>
>I can post details and data if needed but the situation seems to be the same as described in Adam's thread here:
>
>http://web.archiveorange.com/archive/v/rOz2zG8Xv59S4TU6NnYl
>
>Any help appreciated.
>
>Thanks,
>Elinor
>                          
>    [[alternative HTML version deleted]]
>
>
>
>------------------------------
>
>Message: 2
>Date: Tue, 16 Apr 2013 13:09:03 +0200
>From: Nicolas Gavoille <nicolas.gavoille@univ-rennes1.fr>
>To: r-sig-mixed-models@r-project.org
>Subject: [R-sig-ME] Question about Multilevel ZIP model with glmmADMB
>Message-ID: <20130416130903.1380794w1p6bkpjj@webmail.univ-rennes1.fr>
>Content-Type: text/plain
>
>Dear all,
>
>In the framework of my phd thesis in economics, i am currently trying to implement a mutlilevel ZIP model (in a quite "unusual' field): to summarize, I study the monthly count of approved legislation by the parliament. Two (nested) randoms effects are introduced. The first is goverment specific, the second is legislature specific. This design allows to modelize the political context in a quite convincing way. So far, I had good results using a multilevel Poisson model with lme4. However, the abundance of 0 makes me want to go further and to add a "zero-inflated touch" (more relevant in my case than a hurdle). Then i found the glmmADMB package. 
>
>First, i have a little question. Without taking into account the hierarchical level, i tried to implement a simple ZIP model. Then i compared with the results obtained with the pscl package, and the results are quite (very) different. Where does this difference could come from? I've read all that i I have been able to find, but i am still lookking for an answer.
>
>Then, I started by replicating my previous results obtained with lme4, but I got a message error as soon as i introduced the random effects (the function maximizer failed). I found on another post that Ben Bolker suggested to run with noinit=FALSE and shess=FALSE, and it solved this problem: i obtained the same output as with lme4 (just a little difference: the log-likelihood and the AIC, which are respectively much lower and higher here, i am wondering why). 
>
>However, i cannot go further as i cannot obtain any result when i introduce zeroInflation=TRUE... I made some researches, but i didn't find any information about this error message. I join below all the information i have.
>
>Does anybody have an idea about how to overcome the problem? I can send  the dataset in a private message if somebody is puzzled by this issue  and is willing to look at it! In case of, what would be an alternative  program to deal with it? In R, I found the MCMC package, but i am not  familiar at all with Bayesian econometrics...
>
>Thanks a lot!
>
>Nicolas 
>
>Here is the estimated model:
>
>reg1a=glmmadmb(laws2~end2+Expmin5+ ... +laggdp8+(1|legi2)+(1|govbis),
>family="poisson", zeroInflation=TRUE, Z1,verbose=TRUE, admb.opts=admbControl(noinit=FALSE,shess=FALSE))
>
>Here is the error message and the last step of 'verbose'':
>
> - final statistics:
>18 variables; iteration 1; function evaluation 30
>Function value   3.1566e+03; maximum gradient component mag   5.6086e+01
>Exit code = 1;  converg criter   1.0000e-04
>Var   Value    Gradient   |Var   Value    Gradient   |Var   Value    Gradient   
>1 -0.32970  1.74888e+01 |  2 38.68267 -1.15937e+00 |  3 -0.26990  2.56071e+00
>4 -4.92064 -6.30188e+00 |  5 -5.73443 -7.91115e+00 |  6 -0.84531  2.30545e-01
>7 -0.92819 -3.89711e+00 |  8 -8.33580 -5.22392e+00 |  9  6.63303 -6.19944e-02
>10  4.21659 -2.67195e+00 | 11 -2.29660  8.02333e-01 | 12 -0.09014  4.09720e+00
>13 -0.92395 -3.79042e+00 | 14 -2.36985 -2.96378e+00 | 15  0.26876  6.52775e-01
>16 -3.02193 -7.51478e+00 | 17 -0.16595 -4.06174e+00 | 18 -0.04291  5.60859e+01
>inner maxg = -0.0003115470585843827  Inner second time = -0.0003115470585843827  Inner f = 3144.919446454345
>f = 3144.919446454345 max g = 0.0003115470585843827
>...
>
>Newton raphson 1   f = 3161.815402363252 max g = 1.583645103941933e-08
>Newton raphson 2   f = 3161.815402363256 max g = 2.742250870824137e-13
>Warning -- Hessian does not appear to be positive definite
>
>Parameters were estimated, but not standard errors were not: the most likely problem is that the curvature at MLE was zero or negative
>Error in glmmadmb(laws2 ~ end2 + Expmin5 + start3 + Ht + nmin + vac +  : 
>The function maximizer failed (couldn't find STD file) Troubleshooting steps include (1) run with 'save.dir' set and inspect output files; (2) change run parameters: see '?admbControl'
>In addition: Warning messages:
>1: running command 'C:\windows\system32\cmd.exe /c "C:/Users/Andra/Documents/R/win-library/3.0/glmmADMB/bin/windows32/glmmadmb.exe" -maxfn 500 -maxph 5' had status 1 
>2: In shell(cmd, invisible = TRUE, intern = !verbose) :
>'"C:/Users/Andra/Documents/R/win-library/3.0/glmmADMB/bin/windows32/glmmadmb.exe" -maxfn 500 -maxph 5' execution failed with error code 1
>> 
>
>And finally, here is my set up:
>
>R version 3.0.0 (2013-04-03)
>Platform: i386-w64-mingw32/i386 (32-bit)
>
>other attached packages:
>[1] MCMCglmm_2.17    corpcor_1.6.5    ape_3.0-8        tensorA_0.36    
>[5] lme4_0.999999-0  Matrix_1.0-12    pscl_1.04.4      vcd_1.2-13      
>[9] colorspace_1.2-1 gam_1.06.2       coda_0.16-1      lattice_0.20-15 
>[13] mvtnorm_0.9-9994 glmmADMB_0.7.4   R2admb_0.7.7     MASS_7.3-26     
>
>    [[alternative HTML version deleted]]
>
>
>
>------------------------------
>
>Message: 3
>Date: Tue, 16 Apr 2013 10:59:33 -0400
>From: Philip Harrison <pharriso@uwaterloo.ca>
>To: r-sig-mixed-models@r-project.org
>Subject: [R-sig-ME] lme4 crossed random effects predictions
>Message-ID:
>    <20130416105933.15004mrxvpj0p668@www.nexusmail.uwaterloo.ca>
>Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes";
>    format="flowed"
>
>Hi,
>
>I am attempting to reproduce the code from glmm wikidot in order to  
>get predictions for a crossed random effects model made in lme4  
>http://glmm.wikidot.com/faq
>
>library(lme4)
>library(ggplot2) # Plotting
>data("Orthodont",package="MEMSS")
>fm1 <- lmer(
>     formula = distance ~ age*Sex + (age|Subject)
>     , data = Orthodont
>)
>newdat <- expand.grid(
>     age=c(8,10,12,14)
>     , Sex=c("Male","Female")
>     , distance = 0
>)
>mm <- model.matrix(terms(fm1),newdat)
>newdat$distance <- mm %*% fixef(fm1)
>pvar1 <- diag(mm %*% tcrossprod(vcov(fm1),mm))
>tvar1 <- pvar1+VarCorr(fm1)$Subject[1]  ## must be adapted for more  
>complex models
>
>anyone have any ideas on how I might adapt the tvar1 code for a  
>partially crossed random effects model effects model. ie a  
>(1|subjecti)+(1|subjectj) random effect structure?
>
>I am actually going to use the multcomp package to look at significant  
>differences between my categorical fixed effects levels- but i would  
>like to get a visualisation of the data with the prediction method.
>
>Thanks for your time
>
>Phil H
>
>
>
>------------------------------
>
>Message: 4
>Date: Tue, 16 Apr 2013 14:58:18 -0300
>From: Richard Asturia <richard.asturia@gmail.com>
>To: r-sig-mixed-models@r-project.org
>Subject: [R-sig-ME] Cross-level interaction must include constitutive
>    terms of interactions in the following code?
>Message-ID:
>    <CA+xNL7p+7jL74S1JwAgu+FgRo7i+D2OzNEUg=By=iOu-BpAzPQ@mail.gmail.com>
>Content-Type: text/plain
>
>Dears,
>
>I have a model like the following in the first level:
>
>Y = b_0 + b_1*X1
>
>And in the second level, I have a variable X2 which effect only makes sense
>on b_1, not directly on the mean of Y, through b_0. I have two questions.
>
>First, is it correct to model it like the following:
>
>b_0 = j_00 + u0
>b_1 = j_10 + j_11*X2 + u1
>
>So:
>Y = j_00 + u0 + j_10*X1 + j_11*X2*X1 + u1*X1
>
>Or should I also cross-level X2 on the b_0 of level 1 anyway, in spite of
>the what I am theoretically trying to model?
>
>Second, would it be correct to specify such equation with lmer() like the
>following:
>
>lmrob( Y ~ X1+ X1:X2 + (1 | level2 ) + ( 0 + X1 | level2), data=my.data)
>
>Thanks!
>
>R.
>
>    [[alternative HTML version deleted]]
>
>
>
>------------------------------
>
>_______________________________________________
>R-sig-mixed-models mailing list
>R-sig-mixed-models@r-project.org
>https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>
>End of R-sig-mixed-models Digest, Vol 76, Issue 20
>**************************************************
>
>
>
	[[alternative HTML version deleted]]

