저는 R을 처음 접했습니다. 잠시 동안 (R 도움말과 함께)이 포럼을 읽었지만 처음 게시됩니다. 여기에 각 오류를봤을 때, 나는 아직도 내 실수를 찾아 내고 고칠 수 없다.불균형 데이터를 사용하는 단방향 반복 측정 ANOVA
불평등 한 샘플 크기의 단방향 반복 측정 ANOVA를 실행하려고합니다. 다음은 사용중인 데이터 및 코드의 장난감 버전입니다. 복잡성에 대한
Error in qr.qty(qr.e, resp) :
invalid to change the storage mode of a factor
In addition: Warning messages:
1: In model.response(mf, "numeric") :
using type = "numeric" with a factor response will be ignored
2: In Ops.factor(y, z$residuals) : - not meaningful for factors
3: In aov(probability ~ bin + Error(subject/bin), data = dataFrame) :
Error() model is singular
죄송합니다 (
가정 : (.이 중요한 경우, 내 실제 데이터는 각각의 빈에서 최대 14 ~ 20 값으로 12 개 쓰레기통이)## the data: average probability for a subject, given reaction time bin
bin1=c(0.37,0.00,0.00,0.16,0.00,0.00,0.08,0.06)
bin2=c(0.33,0.21,0.000,1.00,0.00,0.00,0.00,0.00,0.09,0.10,0.04)
bin3=c(0.07,0.41,0.07,0.00,0.10,0.00,0.30,0.25,0.08,0.15,0.32,0.18)
## creating the data frame
# dependent variable column
probability=c(bin1,bin2,bin3)
# condition column
bin=c(rep("bin1",8),rep("bin2",11),rep("bin3",12))
# subject column (in the order that will match them up with their respective
# values in the dependent variable column)
subject=c("S2","S3","S5","S7","S8","S9","S11","S12","S1","S2","S3","S4","S7",
"S9","S10","S11","S12","S13","S14","S1","S2","S3","S5","S7","S8","S9","S10",
"S11","S12","S13","S14")
# putting together the data frame
dataFrame=data.frame(cbind(probability,bin,subject))
## one-way repeated measures anova
test=aov(probability~bin+Error(subject/bin),data=dataFrame)
이 내가 얻을 오류는 그것은 복잡하다; 그것은 나에게있다.) 시간 내 주셔서 감사합니다. 불균형 반복-조치 디자인에 대한
반복 측정 ANOVA에서 모든 피험자는 모든 조건에서 정확히 한 번 나타나야하므로 불균등 한 표본 크기를 가질 수 없습니다. 각 보관함에 떨어지지 않는 과목을 드롭해야합니다. 또는 귀하의 데이터가 될 수있는 것처럼 보이면 0 개의 확률 창을 추가하십시오. 또한 오류로 표시되는 변수 유형을 설정해야합니다. ... 처음에는 – John
조언 해 주셔서 감사합니다. 이 [링크] (http://stackoverflow.com/questions/8320603/how-to-do-one-way-anova-in-r-with-unequal-sample-sizes)에 따르면 불평등 한 샘플 크기는 이 분석에 대해서는 괜찮습니다. 또한 형식에 대해 종속 변수 열이 as.numeric 숫자로되어 있는지 확인하려고 시도했지만 (다른 여러 가지 시도도했지만) 아무 것도 작동하지 않는 것 같았습니다. 유형은 무엇이어야 하는가? –