SPSS Statistics

SPSS Statistics

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

 View Only
  • 1.  Propensity Score Matching

    Posted Thu April 14, 2022 09:09 AM
    I am trying to make a control group using propensity score matching. I have 150 cases and I want 1 to 1 matching. I followed the prompts on the PSM tab. SPSS generated a dataset resulting with match IDs for controls. 

    Is there an easy way to code for the control group in my original data file with the match IDs given in the PSM dataset output? Would this involve creating a variable for controls and then merging the datasets by case id? 

    The issue is that the file generated by the program is all of the cases with the matched control "record ID' So I know the ID of the control but I need to label it as the matched control in my original data set. Going through each one by hand could take hours. 


    ------------------------------
    ruben ulloa
    ------------------------------

    #SPSSStatistics


  • 2.  RE: Propensity Score Matching

    Posted Thu April 14, 2022 05:33 PM
    The easiest way to do this, if I understand what you want, is to do the following.
    First, declare a dataset name, say, used
    DATASET DECLARE used.

    Then Paste the syntax from the dialog.
    In that syntax, you will see a line like this.
    MATCHGROUPVAR=%(matchgroup)s FUZZ=.05 DS3=%(tempdsname)s

    Change the last part to specify used.
    MATCHGROUPVAR=%(matchgroup)s FUZZ=.05 DS3=used

    Select all the code from BEGIN PROGRAM through END PROGRAM.  You can do this by triple clicking while the cursor is anywhere inside the program block.

    Run that code by clicking the triangle on the toolbar.

    That will produce a dataset containing just the supplier (control) cases actually used, so if you filter your main dataset just to have the demander cases (or the demander cases that have a nonmissing matchid value if you want only matched cases), you can then just do ADD CASES or the equivalent to produce the final dataset.

    --





  • 3.  RE: Propensity Score Matching

    Posted Sat April 16, 2022 04:59 AM
    I have a follow up question. Does SPSS use either the greedy nearest neighbor, optimal, or replacement algorithm for PSM? Which parameter sets the caliper width?

    ------------------------------
    ruben ulloa
    ------------------------------



  • 4.  RE: Propensity Score Matching

    Posted Sat April 16, 2022 08:32 AM
    The FUZZ parameters define the eligible region for each match.  Any control that falls in that region can be selected, but if exact priority is specified, it will first try to find an exact match.

    It is also possible for the user to provide a small Python function that can accept or reject a candidate match:

    CUSTOMFUZZ can be used to substitute a user-written calculation for the built-in fuzzy calculation. It should specify a Python module name and function as a quoted string, e.g. "mymodule.fuzzycalc". The function should return

    • 0 - no match
    • 1- fuzzy match.
    • It could also return 2 (exact match).

    If the case comparison produced an exact match, this function is not called.


    --





  • 5.  RE: Propensity Score Matching

    Posted Mon May 30, 2022 05:30 PM
    Hi Jon,

    The PSM command used to run on my dataset before by clicking in the dialog boxes. Now, whenever I try to run it, the program gets stuck on the "running fuzzy" part. The entire command is taking a long time to generate outputs and this was not the case before. is there anything you recommend?

    ------------------------------
    ruben ulloa
    ------------------------------



  • 6.  RE: Propensity Score Matching

    Posted Mon May 30, 2022 05:35 PM
    What has changed?  If you installed a fixpack for your version, you should reinstall FUZZY from the Extension Hub.  If that doesn't fix it, send me the syntax you are running and. ideally, the data.

    --