Excel里没有 One-way ANOVA with Repeated Measures
SPSS里能做,不过输出一大段,但是好像没给算出P值,有F值(在某表中Greenhouse Geisser那行)。。
索性自己做了一个VBA 用户定义函数,本想着能输出一张表,但至今不知道怎么搞,目前只能用数组的方式输入F值和P值。
Function ANV1WAYRPT(ByVal RNG As Range) As Variant
Dim RCNT, CCNT, GM, SST, COL, SSC, SSR, SSE, RW, DFT, DFC, DFR, DFE, MST, MSR, MSC, MSE, F, P
CCNT = RNG.Columns.Count
RCNT = RNG.Rows.Count
GM = WorksheetFunction.Average(RNG)
SST = WorksheetFunction.DevSq(RNG)
For Each COL In RNG.Columns
SSC = SSC + (((WorksheetFunction.Average(COL) - GM) ^ 2) * RCNT)
Next
For Each RW In RNG.Rows
SSR = SSR + (((WorksheetFunction.Average(RW) - GM) ^ 2) * CCNT)
Next
SSE = SST - SSR - SSC
DFT = WorksheetFunction.Count(RNG) - 1
DFR = RCNT - 1
DFC = CCNT - 1
DFE = DFT - DFR - DFC
MST = SST / DFT
MSR = SSR / DFR
MSC = SSC / DFC
MSE = SSE / DFE
F = MSC / MSE
P = WorksheetFunction.FDist(F, DFC, DFE)
Dim RSLT()
ReDim RSLT(1)
RSLT(0) = F
RSLT(1) = P
ANV1WAYRPT = RSLT
End Function
SPSS里能做,不过输出一大段,但是好像没给算出P值,有F值(在某表中Greenhouse Geisser那行)。。
索性自己做了一个VBA 用户定义函数,本想着能输出一张表,但至今不知道怎么搞,目前只能用数组的方式输入F值和P值。
Function ANV1WAYRPT(ByVal RNG As Range) As Variant
Dim RCNT, CCNT, GM, SST, COL, SSC, SSR, SSE, RW, DFT, DFC, DFR, DFE, MST, MSR, MSC, MSE, F, P
CCNT = RNG.Columns.Count
RCNT = RNG.Rows.Count
GM = WorksheetFunction.Average(RNG)
SST = WorksheetFunction.DevSq(RNG)
For Each COL In RNG.Columns
SSC = SSC + (((WorksheetFunction.Average(COL) - GM) ^ 2) * RCNT)
Next
For Each RW In RNG.Rows
SSR = SSR + (((WorksheetFunction.Average(RW) - GM) ^ 2) * CCNT)
Next
SSE = SST - SSR - SSC
DFT = WorksheetFunction.Count(RNG) - 1
DFR = RCNT - 1
DFC = CCNT - 1
DFE = DFT - DFR - DFC
MST = SST / DFT
MSR = SSR / DFR
MSC = SSC / DFC
MSE = SSE / DFE
F = MSC / MSE
P = WorksheetFunction.FDist(F, DFC, DFE)
Dim RSLT()
ReDim RSLT(1)
RSLT(0) = F
RSLT(1) = P
ANV1WAYRPT = RSLT
End Function