两个 variables/columns 的中位数
Median of two variables/columns
我知道您可以在其他程序中轻松获得两个变量或列的中位数,但这在 SPSS 中可能吗?例如我有
测量 1 测量 2
1 2
1 2
1 1
2 3
5 4
我想要所有这些的中位数?所以我的答案应该是2.
正如@Andy W 所说,这将完成工作:
*creating sample data.
DATA LIST list/measurement1 measurement2 .
begin data
1 2
1 2
1 1
2 3
5 4
end data.
* data restructure.
dataset name OrigData.
dataset copy Long.
dataset activate Long.
VARSTOCASES /make val from measurement1 measurement2/index=Measurment(val).
* now you can get your answer in the output window.
frequencies val/STATISTICS=median.
* or in a separate dataset.
DATASET DECLARE YourAnswer.
AGGREGATE /OUTFILE='YourAnswer' /BREAK= /val_median=MEDIAN(val).
dataset activate YourAnswer.
我知道您可以在其他程序中轻松获得两个变量或列的中位数,但这在 SPSS 中可能吗?例如我有
测量 1 测量 2
1 2
1 2
1 1
2 3
5 4
我想要所有这些的中位数?所以我的答案应该是2.
正如@Andy W 所说,这将完成工作:
*creating sample data.
DATA LIST list/measurement1 measurement2 .
begin data
1 2
1 2
1 1
2 3
5 4
end data.
* data restructure.
dataset name OrigData.
dataset copy Long.
dataset activate Long.
VARSTOCASES /make val from measurement1 measurement2/index=Measurment(val).
* now you can get your answer in the output window.
frequencies val/STATISTICS=median.
* or in a separate dataset.
DATASET DECLARE YourAnswer.
AGGREGATE /OUTFILE='YourAnswer' /BREAK= /val_median=MEDIAN(val).
dataset activate YourAnswer.