[R-sig-ME] LMER-CorpusData

Phillip Alday phillip@@ld@y @ending from mpi@nl
Tue Oct 9 12:10:37 CEST 2018


I don't think this is the model you're looking for...

1. It's really weird to have your predictors in one dataframe and your
dependent variable in a different one. Are you really sure that the rows
line up like you think they do? If so, why not join the dataframes
earlier (with merge(), plyr::join() or dplyr::join())?

I'm overall quite nervous about namespaces / scope / etc. in your code
-- using attach() isn't recommended practice, especially when you mix
and match things (e.g. your levelX variables aren't in your dataframe,
but the other predictors are). You have to be really careful to make
sure you're using the data you think you're using.

You can do it like you have it, but it makes me very nervous in terms of
computing what you think you're computing.

2. Your levels include the same predictor in both the fixed effects and
as a grouping variable (the part of the random effect after the |) .
This generally doesn't make sense -- there are a number of posts on this
mailing list to that effect (see also
https://rpubs.com/INBOstats/both_fixed_random and
https://www.muscardinus.be/2017/08/fixed-and-random/) -- but it depends
on your data.

In other words, seeing your model specification isn't quite enough -- we
also need to know something about your data, more than your variable
names alone reveal. Even though I work a lot with language data, I still
can't tell enough from your variable names and code what your data
actually represent.


Best,
Phillip




On 10/08/2018 12:46 AM, Taha Omidian wrote:
> Hello,
> 
> I’m trying to fit a mixed effects model to my corpus data. The data has a hierarchical structure. I need to make sure that the final model reflects this nested structure.
> 
> My final model looks like this:
> 
> theMdl<-lmer(dis.norm.j$transformed~disciplinaryGroup+genreGroup+level+(1|student_id)+(1|levelA)+(1|levelB)+(1|levelC),data=thedata, control=lmerControl("bobyqa”))
> 
> where 
> 
> LevelA is genreGroup:genreFamily:student_id
> levelB is disciplinaryGroup:discipline:student_id
> levelC is level:student_id
> 
> Here is a link to my data and R script: https://www.dropbox.com/sh/46r6lv6n89bromk/AABMc8MQmAYhRC3ubJ0Ii7Wma?dl=0
> 
> Thanks 
> 
> Taha
> _______________________________________________
> R-sig-mixed-models using 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