SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
  • 1.  Losing variable labels and recodes

    Posted Fri July 21, 2023 03:31 PM

    I'm having some difficulty with variable labels and recodes in SPSS. When I initially run the syntax (shown below), I get what I expect - variable labels and recoded data. If I run the descriptives again, I lose the variable labels and the second recode (recoding sysmis to 0). I've used this syntax repeatedly and have not had a problem until yesterday.

    ***************************************************************.
    ***MOST & LEAST IMPORTANT CRITERIA FOR RESIDENCY ONLY PROGRAM.

    COMPUTE Q11MVALID = NVALID (Q11_01M TO Q11_16M).
    FREQ Q11MVALID.

    RECODE Q11_01M TO Q11_16M (1 THRU 3 = 1)
    INTO RQ11_01M RQ11_02M RQ11_03M RQ11_04M RQ11_05M RQ11_06M RQ11_07M RQ11_08M RQ11_09M RQ11_10M RQ11_11M
    RQ11_12M RQ11_13M RQ11_14M RQ11_15M RQ11_16M .

    FORMATS RQ11_01M TO RQ11_16M (F1.0).

    TEMP.
    SEL IF Q11MVALID > 0.
    RECODE RQ11_01M TO RQ11_16M (SYSMIS = 0).

    VAR LABELS
    RQ11_01M 'Performance during pathology rotation in veterinary school'
    RQ11_02M 'Exceptional trait noted on a letter of recommendation'
    RQ11_03M 'Which veterinary school they graduated from'
    RQ11_04M 'Performance in didactic pathology course'
    RQ11_05M 'Performance during a residency interview'
    RQ11_06M 'Completed pathology-related externship'
    RQ11_07M 'Prior pathology-related presentations'
    RQ11_08M 'Prior research-related presentations'
    RQ11_09M 'Completed rotating internship'
    RQ11_10M 'Prior research experience'
    RQ11_11M 'Prior practice experience'
    RQ11_12M 'Veterinary school GPA'
    RQ11_13M 'Prior publications'
    RQ11_14M 'Letter of intent'
    RQ11_15M 'GRE score'
    RQ11_16M 'Class rank'.

    DESC RQ11_01M TO RQ11_16M.
    DESC RQ11_01M TO RQ11_16M.
    **********************************************************************************************.



    ------------------------------
    Becky Burzette
    ------------------------------


  • 2.  RE: Losing variable labels and recodes

    Posted Fri July 21, 2023 05:03 PM
    Your variable labels are in the TEMPORARY scope, so they will disappear after the data have been passed once.  Thus you would see them in the first DESCRIPTIVCES output but then they would disappear.  If you put an EXECUTE command after the RECODE, the variable labels will be permanent, because the temporary state will have expired before they are executed.