Displaying 4 results from an estimated 4 matches for "vecdata".
2005 Feb 22
3
Reproducing SAS GLM in R
...de with
glm(),anova() and drop1() (I use sum contrasts to reproduce those Type
III SS values); I've also tried many other things, but this is the only
somewhat reasonable result I get with glm.
> options(contrasts=c("contr.sum","contr.poly"))
> test.glm <- glm(vecData ~ (facCond+facSubj+facRoi)^2)
> anova(test.glm,test="F")
Analysis of Deviance Table
Model: gaussian, link: identity
Response: vecData
Terms added sequentially (first to last)
Df Deviance Resid. Df Resid. Dev F Pr(>F)
NULL...
2005 Feb 18
1
Two-factorial Huynh-Feldt-Test
...ear models. SAS also
calculates the Huynh-Feldt-Test, which is in this case very important to
the users and cannot be replaced with nlme or something of the kind (as
recommended in http://maths.newcastle.edu.au/~rking/R/help/03b/0813.html.
The models I use for the anovas are the following:
aov(vecData ~ (facWithin + facBetweenROI + facBetweenCond)^2)
aov(vecData ~ facBetweenROI + facBetweenCond %in% facWithin +
Error(facBetweenROI %in% facWithin))
aov(vecData ~ facBetweenCond + facBetweenROI %in% facWithin +
Error(facBetweenCond %in% facWithin))
SAS seems to calculate the Huynh-Feldt test for...
2005 Feb 23
1
H-F corr.: covariance matrix for interaction effect
..."repeatedness"
# G-G and H-F corrections for a main effect
# we do the gghf stuff for the ROI, which means ROIs in columns,
# subjects in rows
mtx <- NULL
for (iROI in 1:length(unique( facROI ))) {
for (iSubj in 1:length(unique( facSubj ))) {
mtx <- c(mtx,
mean(vecData[facROI==unique(facROI)[iROI] &
facSubj==unique(facSubj)[iSubj]])
)
}
}
mtx <- matrix(mtx,ncol=length(unique( facROI )),byrow=F)
GgHfROI <- epsi.GG.HF(var(mtx),length(mtx[1,]),length(mtx[,1]))
print(GgHfROI)
# now for the facROI:facCond interaction...how to go about this...
2005 Feb 23
1
H-F corr.: covariance matrix for interaction effect
..."repeatedness"
# G-G and H-F corrections for a main effect
# we do the gghf stuff for the ROI, which means ROIs in columns,
# subjects in rows
mtx <- NULL
for (iROI in 1:length(unique( facROI ))) {
for (iSubj in 1:length(unique( facSubj ))) {
mtx <- c(mtx,
mean(vecData[facROI==unique(facROI)[iROI] &
facSubj==unique(facSubj)[iSubj]])
)
}
}
mtx <- matrix(mtx,ncol=length(unique( facROI )),byrow=F)
GgHfROI <- epsi.GG.HF(var(mtx),length(mtx[1,]),length(mtx[,1]))
print(GgHfROI)
# now for the facROI:facCond interaction...how to go about this...