Menu

Compatibility of R packages

Heiko
2013-04-17
2013-06-26
  • Heiko

    Heiko - 2013-04-17

    Hi Felix,

    when I try to run PS Matching in SPSS 21 (R 2.14.2), I get the following error:

    library     there is no package called 'cem'
    

    Trying to manually install cem leads to:

    package ‘cem’ is not available (for R version 2.14.2)
    

    Interestingly, cem appears to be up-to-date: http://cran.r-project.org/web/packages/cem/index.html
    Maybe I need an older version?

    Thanks for all the good work!

    Best,
    Heiko

     
    • Felix Thoemmes

      Felix Thoemmes - 2013-04-17

      Hi Heiko,
      thanks for the post.

      Yes, I recently noticed this issue too and first thought that it was a
      compatability problem.
      When I encountered this problem of not being able to install the 'cem'
      package, I also verified on CRAN that it is up-to-date (which it was).
      And yet, even from within R (not via the SPSS R-Plugin), I was not
      able to install 'cem'.
      This manual workaround helps:

      1.) Download the 'cem' package here
      http://gking.harvard.edu/cem

      2.) Open R and type

      install.packages("combinat")
      install.packages("C:/Downloads/cem_1.1.5.tar.gz", repos = NULL, type = "source")

      where you need to replace C:/Downloads with the path where you have
      downloaded the tar.gz file.

      Let me know if that does not work for you.

      Best,
      Felix

      On Wed, Apr 17, 2013 at 4:13 AM, Heiko hbreitsohl@users.sf.net wrote:

      Hi Felix,

      when I try to run PS Matching in SPSS 21 (R 2.14.2), I get the following
      error:

      library there is no package called 'cem'

      Trying to manually install cem leads to:

      package ‘cem’ is not available (for R version 2.14.2)

      Interestingly, cem appears to be up-to-date:
      http://cran.r-project.org/web/packages/cem/index.html
      Maybe I need an older version?

      Thanks for all the good work!

      Best,
      Heiko


      Compatibility of R packages


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/psmspss/discussion/general/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
      • Heiko

        Heiko - 2013-04-18

        Hi Felix,

        it appears to work now. Yay!

        Just so you know, after following your instructions, I first got this:

        ERROR: dependency 'randomForest' is not available for package 'cem'

        After manually installing randomForest, installing cem worked.
        I then ran PS Matching in SPSS, during which R automatically installed three more packages (SparseM, xtable, and RItools).

        Thanks again!!!

        Heiko

         
  • Ashkan Labaf

    Ashkan Labaf - 2013-06-17

    Hi Felix,
    I have the same problem as Heiko. I am trying to get a PS matching integrated into SPSS but I seem to have problems to get the R and R essentials to work. When I try to install cem it says that it is no available for 2.14.2. I have SPSS version 21. R seems not not to understand the command
    install.packages("C:/Downloads/cem_1.1.5.tar.gz", repos = NULL, type = "source")
    Sorry to ask, but do you need to type repos=NULL, type ="source") precisely as it says. It seems that I dont understand this part. I have been tryng for 12 days without succeding. Please help me!
    Kind regards
    Ashkan

     
    • Felix Thoemmes

      Felix Thoemmes - 2013-06-17

      Dear Ashkan,
      sorry to hear that you had a hard time installing the program.
      Yes, you need to include repos and type statements, as they basically
      tell R not to download "cem" from the CRAN server, but from your local
      harddrive.
      You also need to download an older version (e.g., 1.1.2) of "cem" here:
      http://gking.harvard.edu/cem

      We are almost finished with our new version of PSMATCHING that will
      once and for all fix the "cem" installation problem that many have
      encountered.

      Best,
      Felix

      On Mon, Jun 17, 2013 at 3:07 PM, Ashkan Labaf ash21@users.sf.net wrote:

      Hi Felix,
      I have the same problem as Heiko. I am trying to get a PS matching
      integrated into SPSS but I seem to have problems to get the R and R
      essentials to work. When I try to install cem it says that it is no
      available for 2.14.2. I have SPSS version 21. R seems not not to understand
      the command
      install.packages("C:/Downloads/cem_1.1.5.tar.gz", repos = NULL, type =
      "source")
      Sorry to ask, but do you need to type repos=NULL, type ="source") precisely
      as it says. It seems that I dont understand this part. I have been tryng for
      12 days without succeding. Please help me!
      Kind regards
      Ashkan


      Compatibility of R packages


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/psmspss/discussion/general/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • Ashkan Labaf

    Ashkan Labaf - 2013-06-18

    Hi Felix,
    Thank you for your quick response! I have tried with cem 1.1.2 as well. I get the feeling that I am typing this specific part incorrectly.

    install.packages("C:/Downloads/cem_1.1.2.tar_0.gz", repos = NULL, type =
    "source")

    I change it off course to the place where I download it from. Should there be a space after "," and after and before "=". I have tried all possible combinations.
    Appreciate the help!

    Best,
    Ashkan

     
    • Felix Thoemmes

      Felix Thoemmes - 2013-06-19

      Hi Ashkan,
      not sure why this is not working. The spacing should not matter.
      Maybe this post will be helpful in explaining how to install a package
      that you downloaded.

      http://stackoverflow.com/questions/1474081/how-do-i-install-an-r-package-from-source

      Best,
      Felix

      On Tue, Jun 18, 2013 at 2:23 AM, Ashkan Labaf ash21@users.sf.net wrote:

      Hi Felix,
      Thank you for your quick response! I have tried with cem 1.1.2 as well. I
      get the feeling that I am typing this specific part incorrectly.

      install.packages("C:/Downloads/cem_1.1.2.tar_0.gz", repos = NULL, type =
      "source")

      I change it off course to the place where I download it from. Should there
      be a space after "," and after and before "=". I have tried all possible
      combinations.
      Appreciate the help!

      Best,
      Ashkan


      Compatibility of R packages


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/psmspss/discussion/general/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • Ashkan Labaf

    Ashkan Labaf - 2013-06-19

    Hi again Felix,

    I have figured out this part. I am able to install all the packages that are recommended including randomForest, "combinat" and the cem 1.1.2 and 1.1.4 (tried both) without success. It seems that R 2.14.2 and the essentials for R 21 are not compatible. When I type (SPSS syntax)

    x <- "R plug-in is working properly"

    x

    END PROGRAM.

    I get this response from SPSS no matter which of the versions I use.
    "The first word in the line is not recognised as an SPSS statistics command. "

    I think that this is the reason why PS matching is not working. I have also tried the latest R version with the same essentials for R 21. I have the version 21 of SPSS. Sorry to write again, but I am working against a deadline. Would appreciate it for the world if you could help me with this one.

    Best,
    Ashkan

     
    • Felix Thoemmes

      Felix Thoemmes - 2013-06-19

      Hi Ashkan,
      based on your description, this is definitely a problem with the SPSS
      R-Essentials plugin.
      Have you checked the SPSS documentation on how to install the R-plugin?
      ftp://public.dhe.ibm.com/software/analytics/spss/documentation/statistics/21.0/en/rplugin/InstallationDocuments/Windows/Essentials_for_R_Installation_Instructions.pdf

      Best,
      Felix

      On Wed, Jun 19, 2013 at 2:24 PM, Ashkan Labaf ash21@users.sf.net wrote:

      Hi again Felix,

      I have figured out this part. I am able to install all the packages that are
      recommended including randomForest, "combinat" and the cem 1.1.2 and 1.1.4
      (tried both) without success. It seems that R 2.14.2 and the essentials for
      R 21 are not compatible. When I type (SPSS syntax)

      x <- "R plug-in is working properly"

      x

      END PROGRAM.

      I get this response from SPSS no matter which of the versions I use.
      "The first word in the line is not recognised as an SPSS statistics command.
      "

      I think that this is the reason why PS matching is not working. I have also
      tried the latest R version with the same essentials for R 21. I have the
      version 21 of SPSS. Sorry to write again, but I am working against a
      deadline. Would appreciate it for the world if you could help me with this
      one.

      Best,
      Ashkan


      Compatibility of R packages


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/psmspss/discussion/general/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • Ashkan Labaf

    Ashkan Labaf - 2013-06-19

    Hi Felix,
    I have read that one. I am using windows 8 and I run the R-plug as an administrator. Simply wont work! Get the same response in the syntax. All the version should match. Other leads?

    Best,
    Ashkan

     
    • Felix Thoemmes

      Felix Thoemmes - 2013-06-19

      Never tested windows 8 before - this could be a potential issue, even
      though it really shouldn't.
      A couple of suggestions: check the SPSS developer forum and post your
      question there. Since this is a problem with the communication between
      the R-plugin and SPSS, they might be able to help you. Jon Peck is
      active on these forums and he is very knowledgeable.
      https://www.ibm.com/developerworks/community/forums/html/category?id=33333333-0000-0000-0000-000000000302

      Second solution would be to switch completely to R and use the
      MatchIt() package.
      Finally, John Painter (UNC) has an SPSS macro (not a dialog or
      extension) that performs simple propensity score matching.

      Hope that helps,
      Felix

      On Wed, Jun 19, 2013 at 2:53 PM, Ashkan Labaf ash21@users.sf.net wrote:

      Hi Felix,
      I have read that one. I am using windows 8 and I run the R-plug as an
      administrator. Simply wont work! Get the same response in the syntax. All
      the version should match. Other leads?

      Best,
      Ashkan


      Compatibility of R packages


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/psmspss/discussion/general/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • Ashkan Labaf

    Ashkan Labaf - 2013-06-19

    Hi Felix,
    I managed to get R and plug-in work by marking the whole lines to the left in the syntax (I am sorry, but I am beginner). But the problem remains with PS matching. I have installed cem_1.1.2, randomForest, and all the packages that the output suggests. This is the response in the output window when I try to do some calculation in PS matching:

    Loading required package: MASS

    MatchIt (Version 2.4-20, built: 2011-10-24)

    Please refer to http://gking.harvard.edu/matchit for full documentation

    or help.matchit() for help with commands supported by MatchIt.

    Package SparseM (0.97) loaded.
    To cite, see citation("SparseM")

    Loading required package: nlme
    Loading required package: lattice
    Loading required package: randomForest
    Error: package 'randomForest' could not be loaded
    In addition: Warning message:
    In library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) :
    there is no package called 'randomForest'
    Error: object 'pt3' not found
    Loading required package: randomForest
    Error: package 'randomForest' could not be loaded
    In addition: Warning message:
    In library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) :
    there is no package called 'randomForest'
    Warning message:
    In OK() : No warnings in estimation or matching procedure
    Error: unexpected input in:

    I have even typed install.packages("MatchIt") which installs correctly I guess. Any other clues?
    Best,
    Ashkan

     
    • Felix Thoemmes

      Felix Thoemmes - 2013-06-20

      Hello Ashkan,
      it's still not easy to pinpoint, but it seems that the problem is with
      the "random forest" package.
      Two suggestions: uninstall and reinstall the "random forest" package
      directly in R.
      Alternatively, contact me off-list and I can send you the pre-release
      version of PSMATCHING3 that may work better with your system.
      Best,
      Felix

      On Wed, Jun 19, 2013 at 5:53 PM, Ashkan Labaf ash21@users.sf.net wrote:

      Hi Felix,
      I managed to get R and plug-in work by marking the whole lines to the left
      in the syntax (I am sorry, but I am beginner). But the problem remains with
      PS matching. I have installed cem_1.1.2, randomForest, and all the packages
      that the output suggests. This is the response in the output window when I
      try to do some calculation in PS matching:

      Loading required package: MASS

      MatchIt (Version 2.4-20, built: 2011-10-24)

      Please refer to http://gking.harvard.edu/matchit for full documentation

      or help.matchit() for help with commands supported by MatchIt.

      Package SparseM (0.97) loaded.
      To cite, see citation("SparseM")

      Loading required package: nlme
      Loading required package: lattice
      Loading required package: randomForest
      Error: package 'randomForest' could not be loaded
      In addition: Warning message:
      In library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc =
      lib.loc) :
      there is no package called 'randomForest'
      Error: object 'pt3' not found
      Loading required package: randomForest
      Error: package 'randomForest' could not be loaded
      In addition: Warning message:
      In library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc =
      lib.loc) :
      there is no package called 'randomForest'
      Warning message:
      In OK() : No warnings in estimation or matching procedure
      Error: unexpected input in:

      I have even typed install.packages("MatchIt") which installs correctly I
      guess. Any other clues?
      Best,
      Ashkan


      Compatibility of R packages


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/psmspss/discussion/general/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
      • Ashkan Labaf

        Ashkan Labaf - 2013-06-26

        Hi Felix!
        I would really appreciate that. But I have some difficulties to find your email. Please e-amil at ashkan.labaf@gmail.com.
        Thanks a lot!
        Best,
        Ashkan

         

Log in to post a comment.