[R-sig-ME] Free statistical analysis material?
Luca Danieli
mr@luced@n @ending from hotm@il@it
Mon May 14 22:38:35 CEST 2018
Thank you for confirming the confusion.
In general, in the example the first contrast is about the first effect/variable (in this case a "musical closure") and has 4 conditions, so I create a contrast like:
condition 4 > conditions 1, 2, 3
-> cl_c1 = c(-1/3,-1/3,-1/3,1)
Now I want to look at another effect/variable (named "position"). This has 8 conditions and I have to make a contrast like
conditions 1, 2 > conditions 3, 4, 5, 6, 7, 8
Hipotetically should be (?):
-> ps_c1 = c(0.5, 0.5, -1/6, -1/6, -1/6, -1/6, -1/6, -1/6)
? Guess I am wrong?
Btw, I received the following reply from the mailing list by a certain Elisa Rose. Maybe you want to dig into the issue?
Hey {fullname} ///I guess that given the mailing list it couldn't detect my name
Thanks for your response. Can I have a pic or two to start talking? Please respond with pics/infos, Hope to hear back from you asap.
Thanks,
________________________________
From: R-sig-mixed-models <r-sig-mixed-models-bounces at r-project.org> on behalf of Ben Bolker <bbolker at gmail.com>
Sent: 14 May 2018 20:56
To: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] Free statistical analysis material?
Contrasts are confusing, and not specific to LMMs. You might see if
http://bbolker.github.io/mixedmodels-misc/notes/contrasts.pdf
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.
>
> ----
>
> library(lmerTest)
>
> str(datasheet.complete)
> # set Score as numeric
> datasheet.complete$Score = as.numeric(datasheet.complete$Score)
>
> levels(datasheet.complete$Closure)
>
> # 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]
> closuremat
>
> # 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]
> expmat
>
> # 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)
>
> anova(modela,modelb,modelc,modeld)
>
> model = lmer(Score~Closure*ExpertiseType+(1|Participant)+(1|Item), data = datasheet.complete, REML = TRUE)
> summary(model)
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
_______________________________________________
R-sig-mixed-models at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list