Date: Fri, 16 Dec 2011 16:34:30 +0000
Reply-To: Kathryn Gardner <kjgardner10@hotmail.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Kathryn Gardner <kjgardner10@hotmail.com>
Subject: Re: Multiple imputation for different types of missing values
In-Reply-To: <1324042351181-5080275.post@n5.nabble.com>
Content-Type: multipart/alternative;
Hi Bruce,
You are correct in that I do have a question that asks whether they drink alcohol or not (YES/NO), and some participants have actually answered no but then proceeded to answer the cageaid questions, but others have said yes and then scored 0 on the cageaid questions. I think I can re-work David's code here, but I do have other questionnaires where participants have missed out a set of 10 questions because they ask about their father and these were skipped if they were not raise by their father (I didn't include an initial Yes/NO question here though so can easily adapt David's code).
Thank you for your suggestion.
Kathryn
> Date: Fri, 16 Dec 2011 05:32:31 -0800
> From: bruce.weaver@hotmail.com
> Subject: Re: Multiple imputation for different types of missing values
> To: SPSSX-L@LISTSERV.UGA.EDU
>
> Kathryn, in your first post, you said, "I'm trying to figure out a way to run
> the analysis, without imputing missing values for those participants who
> have missed out say all 5 items on an alcohol questionnaire because they
> were told to skip it if they do not drink alcohol." This makes me wonder if
> there is another dichotomous variable in your file (Drinks_Alcohol - Y/N)
> that can be used instead of NVALID(cageaid_2 TO cageaid_5)= 0. Assuming
> there is such a variable, and it's coded 1=Y, 0=N, David's line that
> computes @nukeme@ could be changed to:
>
> COMPUTE @nukeme@= NOT drinks_alcohol.
>
> I think this is preferable, because for whatever reason (e.g., data entry
> error), someone might have zeros for cageaid_2 to cageaid_5, despite having
> a YES for drinks_alcohol. It's also simpler code.
>
> HTH.
>
>
>
> David Marso wrote
> >
> > Kathryn ,
> > Looks like the line
> > + DO REPEAT imputation_=cageaid_2 TO cageaid_5.> + COMPUTE
> > imputation_=$SYSMIS .
> > may be the culprit. Should be 2 lines (sans >). Also modified logical
> > flag for (imputation_).
> > HTH, David
> > ---
> > * Do *NOT* change $CASENUM to ID!!! (This is to enable restoration to
> > original order) .
> > COMPUTE @ordered@= $CASENUM.
> > SORT CASES BY ID imputation_.
> > COMPUTE @nukeme@=NVALID(cageaid_2 TO cageaid_5)= 0.
> > * Probably need following change
> > IF ID=LAG(ID) AND ( imputation_ GE 1) @nukeme@=LAG(@nukeme@).
> > DO IF @nukeme@.
> > + DO REPEAT imputedvar=cageaid_2 TO cageaid_5.
> > * Following line was previously munged into DO REPEAT line * Possible
> > received error mesage? *.
> > + COMPUTE imputatedvar=$SYSMIS .
> > + END REPEAT.
> > END IF.
> > * Restore data to order of imputed data sets.
> > SORT CASES BY @ordered@.
> >
> >
> > Kathryn Gardner wrote
> >>
> >> thanks David. I'm a bit of a novice when it comes to syntax and can only
> >> do basic stuff and am not clear about all of the commands. You are
> >> correct in that MI produces 1 data file with a variable called
> >> Imputation_ coded 0 (raw), 1, 2, 3, 4, 5 for 5 imputed data sets. I tried
> >> to get the second set of code to run. I changed the syntax so that impfag
> >> = imputation_, $casenum to ID, and also changed the name of my alcohol
> >> items. It partly runs and adds the variables @nukeme@ and @ordered@ to
> >> the data file, and then in the @nukeme@ column it's coded any case with
> >> missing data on the alcohol items as 1, and also coded as 1 those cases
> >> with the same ID number but whose data on CAGEAID_2 to CAGEAID_5 has been
> >> imputed. I thought it would change the latter to system missing values
> >> though?
> >>
> >> COMPUTE @ordered@= ID.
> >> SORT CASES BY ID imputation_.
> >> COMPUTE @nukeme@=NVALID(cageaid_2 TO cageaid_5)= 0.
> >> IF ID=LAG(ID) AND imputation_ @nukeme@=LAG(@nukeme@).
> >> DO IF @nukeme@.
> >> + DO REPEAT imputation_=cageaid_2 TO cageaid_5.> + COMPUTE
> >> imputation_=$SYSMIS .
> >> + END REPEAT.
> >> END IF.
> >> SORT CASES BY @ordered@.
> >>
> >>
> >>> Date: Thu, 15 Dec 2011 02:29:17 -0800
> >>> From: david.marso@
> >>> Subject: Re: Multiple imputation for different types of missing values
> >>> To: SPSSX-L@.UGA
> >>>
> >>> "The only solution I could come up with was running the MI, then
> >>> manually
> >>> scanning thousands of rows of data and deleting the imputed values on
> >>> the
> >>> alcohol measure..."
> >>> Anytime you begin to manually scan thousands of rows... *STOP*!
> >>> RETHINK!!
> >>> "there must be a simpler way." Yes! It is called Syntax!
> >>> ---
> >>> Assuming something like alcohol measure = alc01 to alc05. Imputed
> >>> values
> >>> imp01 to imp05.
> >>> DO IF NVALID(alc01 TO alc05)=0.
> >>> DO REPEAT imp=imp01 TO imp05.
> >>> COMPUTE imp=$SYSMIS . /* or set to some value to be declared later as
> >>> missing */.
> >>> END REPEAT.
> >>> END IF.
> >>> ---
> >>> OTOH: I don't have this module so not certain what the data come back
> >>> with?
> >>> ---
> >>> I suspect you actually end up with the raw non-imputed data at the top
> >>> and
> >>> several imputed data sets below? Hopefully with some sort of consistent
> >>> ID
> >>> variable (ID)
> >>> and some sort of imputation flag impflag (0 raw, 1 imputed)?.
> >>> COMPUTE @ordered@=$CASENUM.
> >>> SORT CASES BY ID impflag.
> >>> COMPUTE @nukeme@=NVALID(alc01 TO alc05)=0.
> >>> IF ID=LAG(ID) AND impflag @nukeme@=LAG(@nukeme@).
> >>> DO IF @nukeme@.
> >>> + DO REPEAT imp=alc01 TO alc05.
> >>> + COMPUTE imp=$SYSMIS . /* or set to some value to be declared later
> >>> as
> >>> missing */.
> >>> + END REPEAT.
> >>> END IF.
> >>> SORT CASES BY @ordered@.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> Kathryn Gardner wrote
> >>> >
> >>> > Dear List,I am running a multiple imputation on lots of questionnaire
> >>> > items and I'm trying to figure out a way to run the analysis, without
> >>> > imputing missing values for those participants who have missed out say
> >>> all
> >>> > 5 items on an alcohol questionnaire because they were told to skip it
> >>> if
> >>> > they do not drink alcohol. I don't want to exclude the alcohol measure
> >>> > entirely from the MI because there are also randomly missing values
> >>> across
> >>> > these alcohol items that do need imputing. At the moment all missing
> >>> > values are identified as system missing in the data file, and I
> >>> thought
> >>> > there might be a way to get SPSS to only run the MI on certain types
> >>> of
> >>> > missing values if I coded the ones I want to be ignored as user
> >>> missing,
> >>> > but this doesn't seem possible. The only solution I could come up with
> >>> was
> >>> > running the MI, then manually scanning thousands of rows of data and
> >>> > deleting the imputed values on the alcohol measure for the
> >>> participants
> >>> > who skipped the entire questionnaire. As you can imagine, this is
> >>> taking
> >>> > hours! There must be a simpler way. Any advice greatly appreciated.
> >>> Kind
> >>> > regards,Kathryn
> >>> >
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>> http://spssx-discussion.1045642.n5.nabble.com/Multiple-imputation-for-different-types-of-missing-values-tp5076972p5077084.html
> >>> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
> >>>
> >>> =====================
> >>> To manage your subscription to SPSSX-L, send a message to
> >>> LISTSERV@.UGA (not to SPSSX-L), with no body text except the
> >>> command. To leave the list, send the command
> >>> SIGNOFF SPSSX-L
> >>> For a list of commands to manage subscriptions, send the command
> >>> INFO REFCARD
> >>
> >
>
>
> -----
> --
> Bruce Weaver
> bweaver@lakeheadu.ca
> http://sites.google.com/a/lakeheadu.ca/bweaver/
>
> "When all else fails, RTFM."
>
> NOTE: My Hotmail account is not monitored regularly.
> To send me an e-mail, please use the address shown above.
>
> --
> View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Multiple-imputation-for-different-types-of-missing-values-tp5076972p5080275.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
[text/html]
|