English 中文(简体)
根据SPSS syntax的另一栏,在一行中出现缺失的数值吗?
原标题:Fill in missing values in a row based on another column SPSS syntax?
  • 时间:2023-12-17 01:04:12
  •  标签:
  • spss

我愿用一个专用栏目的数值填写缺失的浏览值。

现有表格:(Measure_Table)

sID Visit value_1 value_2 value_3 value_Score whyMissing
1 1 3 2 5 12
1 2 1 2 5 12
1 3 6 2 5 12
2 1 8 2 5 12
2 2 -30
2 3 -10
3 1 2 2 1 12
3 2 7 8 9 12
3 3 -10

I have been trying to use this syntax, but when I do, it runs but the values from whyMissing do not populate into the other columns. It is important to me to do this with multiple columns because my dataset is larger than what I have shown here.

希望结果表:Outcome_Measure_Table

sID Visit value_1 value_2 value_3 value_Score whyMissing
1 1 3 2 5 12
1 2 1 2 5 12
1 3 6 2 5 12
2 1 8 2 5 12
2 2 -30 -30 -30 -30 -30
2 3 -10 -10 -10 -10 -10
3 1 2 2 1 12
3 2 7 8 9 12
3 3 -10 -10 -10 -10 -10

这是能够运行的辛迪加,但在我向间谍出口时,它不会分散价值。 如果说是真的,我就只用填满! 我愿意接受其他使用间谍的做法! 如果我能够利用接口和过去yn子来这样做,那么 later也就能够使用。

我的多变观点认为,这些缺失的价值观中有一些是 lo—— 0. 这样做的方式和方式如何绕过?

DO REPEAT vr=value_1 TO value_Score.
    IF NOT MISSING(whyMissing) vr=whyMissing.
END REPEAT.
问题回答

总而言之,辛奈应当工作。 请检查:

  1. Did you run Execute at the end of the process?
  2. Make sure "whyMissing" is a numeric variable.

如果他们不提供帮助,则试图这样做:

DO REPEAT vr=value_1 TO value_Score.
    IF MISSING(vr) vr=whyMissing.
END REPEAT.
execute.

问题是,特别安全局如何处理缺失的价值观! 非常感谢您对 above的帮助。

*recode the missing values to -9 (or whatever you want) that will be replaced by the whyMissing Variable.
RECODE value_1 TO value_Score (SYSMIS = -9). 

*create a list of variables you want to change. Then run if whyMissing has an error code, replace that variable.

do repeat vr=value_1 to value_Score.
  if whyMissing<0 vr=whyMissing.
end repeat.
EXECUTE.




相关问题
SPSS Python Error

Getting the following error when trying to run SPSS from an external Python IDE. import spss yields the following error Traceback (most recent call last): File "C:Documents and SettingsUSER...

SPSS Set Page breaks in Syntax

Is it possible to set page breaks using syntax for the Output viewer? I am looking for ways to programmatically control the content in the output window; everything seems to be done by pointing and ...

Exact binomial test in SAS or SPSS?

I have 400,000 rows, each with an id, number of trials, and number of successes. I have (one) value for p, a hypothesized probability of success. I d like to calculate an exact, binomial, one-sided ...

linking info of pairs of respondents (couples) in SPSS

I am preparing for analyses of the determinants of partner choice in SPSS, but basically I can t get off the ground because I don t know how to create new variables based on the information of each ...

Specifying relative paths in SPSS 18

In SPSS 11 it was possible to specify relative paths. Example: FILE HANDLE myfile= ....datacurrent.txt /LRECL=533. DATA LIST FILE=myfile / ... This worked because apparently, SPSS 11 set the ...

SPSS and PHP/MySQL Integration

I apologize up front for the broadness of this question, but I m wondering if anyone has any suggestions/pointers. A friend s company uses SPSS for statistical data, surveys, etc. They d like to be ...

热门标签