[R-sig-ME] Free statistical analysis material?
bbolker @ending from gm@il@com
Mon May 14 21:56:02 CEST 2018
Contrasts are confusing, and not specific to LMMs. You might see if
helps at all. (From a quick glance at your question & code below, I'm
not sure what you mean by "2 conditions > 6 conditions" ???)
On 2018-05-14 03:48 PM, Luca Danieli wrote:
> Hello everybody,
> I am trying the difficult task to conclude an interdisciplinary PhD.
> Statistics looks nice, and I have learned a lot about the basic principles and methodologies, and how they work.
> But I miss a lot. In particular all the little variations and methods due to interpretations and methodologies (for example now I am looking at the function of contrasts in mixed-effects models), and generally, from theory to applied statistics there is an incredible gap.
> Is anybody in this list (as I don't really have a mentor on statistics nor I know statisticians) be able to point me to some free materials (books, tutorials) to study the topic in detail, but not too much in detail?
> For example, in this moment, I am trying to figure the following script out. I understand it on its general lines, but there are really obscure points in my head on understanding the "why".
> In the following example, what I don't understand is just the contrasts, but the person who is following me (who is a very nice person) has given me the task to figure out the best way to make a contrast "2 conditions > 6 conditions". She has suggested some guessing, but she is not a specialist.
> I was thinking that maybe you that are specialists know some free not-too-long source that I could read to move around.
> # set Score as numeric
> datasheet.complete$Score = as.numeric(datasheet.complete$Score)
> # closure contrasts
> cl_c1 = c(-1/3,-1/3,-1/3,1)
> cl_c2 = c(-1/2,-1/2,1,0)
> cl_c3 = c(-1,1,0,0)
> closuremat.temp = rbind(constant = 1/4,cl_c1,cl_c2,cl_c3)
> closuremat = solve(closuremat.temp)
> closuremat = closuremat[, -1]
> # expertise contrasts
> exp_c1 = c(-1/2,-1/2,1)
> exp_c2 = c(-1,1,0)
> expmat.temp = rbind(constant = 1/3,exp_c1,exp_c2)
> expmat = solve(expmat.temp)
> expmat = expmat[, -1]
> # set contrast
> contrasts(datasheet.complete$Closure) = closuremat
> contrasts(datasheet.complete$ExpertiseType) = expmat
> modela = lmer(Score~1+(1|Participant)+(1|Item), data = datasheet.complete, REML = TRUE)
> modelb = update(modela,.~.+ExpertiseType)
> modelc = update(modelb,.~.+Closure)
> modeld = update(modelc,.~.+ExpertiseType*Closure)
> model = lmer(Score~Closure*ExpertiseType+(1|Participant)+(1|Item), data = datasheet.complete, REML = TRUE)
> [[alternative HTML version deleted]]
> R-sig-mixed-models at r-project.org mailing list
More information about the R-sig-mixed-models