SPSS Statistics

SPSS Statistics

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


#Analytics
#SPSSStatistics
#Analyticstools
 View Only
  • 1.  Problem with propensity score matching

    Posted 09/02/20 06:31 PM

    Hey , can you please help with the following problem. When running PS matching I get the following message.

    SET SEED = 1234.

    SET PRINTBACK=NONE.

    Warning message: In library(cem, logical.return = TRUE) : there is no package called 'cem' Installing package into 'C:/ProgramData/IBM/SPSS/Statistics/24/extensions' (as 'lib' is unspecified) Warning: dependency 'randomForest' is not available There is a binary version available but the source version is later: binary source needs_compilation cem 1.1.17 1.1.20 FALSE installing the source package 'cem' trying URL 'http://cran.r-project.org/src/contrib/cem_1.1.20.tar.gz' Content type 'application/x-gzip' length 2153944 bytes (2.1 MB) downloaded 2.1 MB The downloaded source packages are in 'C:\Users\Shuja\AppData\Local\Temp\spss16696\RtmpKKeSZV\downloaded_packages' Warning messages: 1: running command '"C:/Program Files/R/R-3.2.0/bin/x64/R" CMD INSTALL -l "C:\ProgramData\IBM\SPSS\Statistics\24\extensions" C:\Users\Shuja\AppData\Local\Temp\spss16696\RtmpKKeSZV/downloaded_packages/cem_1.1.20.tar.gz' had status 1 2: In install.packages("cem", repos = "http://cran.r-project.org") : installation of package 'cem' had non-zero exit status Error in library(cem) : there is no package called 'cem' Warning message: In OK() : No warnings in estimation or matching procedure

    Error: could not find function "imbalance"






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: Problem with propensity score matching

    Posted 09/02/20 07:21 PM

    Apparently, psmatchin3 requires the R cem package, which is not installed.

    Try installing it this way.

    begin program r.

    install.packages('cem')

    end program.

    It will put up a list of sites to install from. Pick any convenient one.

    You may get a nonzero status code from that install, but it may work anyway. After running that, try this to see if it is usable

    begin program r.

    library(cem)

    end program.

    Note: PSMATCHING3 is not from IBM.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 3.  RE: Problem with propensity score matching

    Posted 09/02/20 07:57 PM

    Thank you Jon,

    I have PSMatching_2. But running the syntax that you told me give me the following error. Can you please guide me.


    begin program r.


    install.packages('cem')


    end program.

    Installing package into 'C:/ProgramData/IBM/SPSS/Statistics/24/extensions'

    (as 'lib' is unspecified)

    Warning: dependency 'randomForest' is not available


     There is a binary version available but the source version is later:

       binary source needs_compilation

    cem 1.1.17 1.1.20            FALSE


    installing the source package 'cem'


    trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/cem_1.1.20.tar.gz'

    Content type 'application/x-gzip' length 2153944 bytes (2.1 MB)

    downloaded 2.1 MB



    The downloaded source packages are in

    'C:\Users\Shuja\AppData\Local\Temp\spss16696\RtmpKKeSZV\downloaded_packages'

    Warning messages:

    1: running command '"C:/Program Files/R/R-3.2.0/bin/x64/R" CMD INSTALL -l "C:\ProgramData\IBM\SPSS\Statistics\24\extensions" C:\Users\Shuja\AppData\Local\Temp\spss16696\RtmpKKeSZV/downloaded_packages/cem_1.1.20.tar.gz' had status 1

    2: In install.packages("cem") :

     installation of package 'cem' had non-zero exit status


     






    #SPSSStatistics
    #Support
    #SupportMigration


  • 4.  RE: Problem with propensity score matching

    Posted 09/02/20 07:59 PM

    When I enter the begin command in new syntax - it says "there is no package called "cem"






    #SPSSStatistics
    #Support
    #SupportMigration


  • 5.  RE: Problem with propensity score matching

    Posted 09/02/20 08:09 PM

    Looks like you got cem, so now do the same thing with randomForest






    #SPSSStatistics
    #Support
    #SupportMigration


  • 6.  RE: Problem with propensity score matching

    Posted 09/02/20 08:12 PM

    But when I enter the begin command in new syntax - it says "there is no package called "cem"


    And what command should I put for forest plot ?


    Thanks a lot for your help Jon






    #SPSSStatistics
    #Support
    #SupportMigration


  • 7.  RE: Problem with propensity score matching

    Posted 09/03/20 01:07 PM

    You need to change the insert.package call to

    insert.package('randomForest')






    #SPSSStatistics
    #Support
    #SupportMigration