I came upon this because I wanted to emulate Welch's t-test using gls
. I found the answer here:
https://stats.stackexchange.com/a/144480/141304
and it says to add weights with
gls(y ~ group, data = dat, weights=varIdent(form = ~ 1 | group))
y
and group
are variables in the model. I don't know what form
is. I read through help on gls
, glm
, weights
, etc. but couldn't find anything that addressed the issue.
Some tutorials on R formulas filled me in that the pipe means conditioning, just like in probability. I understand conditioning in probability, but I can't wrap my head around what it means in regression.
Suppose I have four predictor variables A, B, C, D and a response variable X. A and B are continuous; C and D are categorical with two levels.
What would formulas such as the ones below (or any other ones an answerer might want to explain) mean?
X ~ A + A|B
X ~ A + B|C
X ~ A + B + C|D