[R-sig-ME] One model of two subsets of data

João Veríssimo j|@ver|@@|mo @end|ng |rom gm@||@com
Fri Jun 9 21:39:58 CEST 2023


I don't know if that can be derived from model1, but I believe with the 
formula
-1/RT ~ item_num / Condition + (item_num / Condition | Subject)
you would be estimating the Condition effects for both 'even' and 'odd' 
item_num, as well as the correlation between the two corresponding 
by-subject random slopes.

-- 
João Veríssimo

On 09/06/2023 21:29, Timothy MacKenzie wrote:
> Hello All,
>
> I have two questions:
>
> First, I was wondering if "model_2" (even subset of items in model_1)
> and "model_3" (odd subset of items in model_1) results (fixed and
> random) can be derived from model_1?
>
> Second, from "model_2" and "model_3", suppose I draw the `Subject`
> random effects and correlate them:
>
> ranef_model_2_even = data.frame(ranef(model_2)$Subject)
> ranef_model_2_even$Subject <- row.names(ranef_model_2_even)
> ranef_model_3_odd = data.frame(ranef(model_3)$Subject)
> ranef_model_3_odd$Subject <- row.names(ranef_model_3_odd)
>
> Subject = merge(ranef_model_2_even, ranef_model_3_odd, by = "Subject",
> suffixes = c("_even", "_odd"))
> cor(Subject$Conditionunrelated_even, Subject $Conditionunrelated_odd)
> #  [1] 0.849635
>
>
> **** Could we obtain the latent equivalent of the above correlation
> (which may not be numerically the same as 0.849635) from
> `VarCorr(model_1)`?
>
> Thank you all, Tim M
>
> ## Reproducible data and code:
> d = read.csv("https://raw.githubusercontent.com/fpqq/w/main/d3.csv")
> library(optimx)
> library(blme)
>
> model_1 = blmer(I(-1/RT) ~ Condition:item_num +
> (Condition:item_num|Subject) + (Condition:item_num|Item), data = d,
>               control=lmerControl(optimizer="optimx",optCtrl=list(method="nlminb")))
>
> # Subset 1:
> model_2 = blmer(I(-1/RT) ~ Condition + (Condition|Subject) + (Condition|Item),
> data = d, control=lmerControl(optimizer="optimx",optCtrl=list(method="nlminb")),
>             subset = item_num == "Even")
>
> # Subset 2:
> model_3 = blmer(I(-1/RT) ~ Condition + (Condition|Subject) + (Condition|Item),
> data = d, control=lmerControl(optimizer="optimx",optCtrl=list(method="nlminb")),
>               subset = item_num == "Odd")
>
> _______________________________________________
> R-sig-mixed-models using r-project.org  mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

-- 
*João Veríssimo*
Assistant Professor | /Professor Auxiliar/
School of Arts and Humanities | /Faculdade de Letras/
University of Lisbon | /Universidade de Lisboa/
	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list