SPSS Statistics

 View Only
  • 1.  SPSS v.29 how to load 'AER' and 'lmtest' for R?

    Posted Tue January 24, 2023 09:53 AM
    I'm new to R and don't see a way to load these packages in SPSS. I need to run a Tobit regression, but get  the error message "Error: The R AER package is required but could not be loaded." 

    If I type in the syntax window, " install.packages ("AER"). " I get the error message ">Error # 1. Command name: install
    >The first word in the line is not recognized as an SPSS Statistics command.
    >Execution of this command stops."

    If I type in the syntax window:" 
    BEGIN PROGRAM R
    install.packages ("lmtest")
    END PROGRAM.

    I get this error:
    Installing package into 'C:/Users/ckcln/AppData/Roaming/IBM/SPSS Statistics/one/extensions'
    (as 'lib' is unspecified)
    Error in contrib.url(repos, "source") :
    trying to use CRAN without setting a mirror
    Calls: install.packages -> contrib.url

    Any help is appreciated,
    Clint

    ------------------------------
    Clint Cook
    ------------------------------


  • 2.  RE: SPSS v.29 how to load 'AER' and 'lmtest' for R?

    IBM Champion
    Posted Tue January 24, 2023 09:56 AM
    Any required R packages should have been installed automatically along with the extension, but try installing them using the STATS PACKAGE INSTALL extension command, which can be installed via Extensions > Extension Hub if you don't already have it.  It appears on the Extensions menu once installed.

    ------------------------------
    Jon Peck
    ------------------------------



  • 3.  RE: SPSS v.29 how to load 'AER' and 'lmtest' for R?

    Posted Tue January 24, 2023 11:27 AM
    Ah yes, thank you for that quick response; it worked. Turns out the package installer is now called 'Install Python and R Packages' in the extension hub, but I managed to figure it all out thanks to your suggestions.  Cheers!

    ------------------------------
    Clint Cook
    ------------------------------



  • 4.  RE: SPSS v.29 how to load 'AER' and 'lmtest' for R?

    IBM Champion
    Posted Tue January 24, 2023 12:52 PM
    Glad that worked.  STATS PACKAGE INSTALL is the actual syntax command, but Install Python and R Modules is the title and menu text.

    --





  • 5.  RE: SPSS v.29 how to load 'AER' and 'lmtest' for R?

    Posted Wed February 22, 2023 05:47 AM

    Thanks again Jon, only replying because I was trying to install this on my laptop and forgot the steps that were necessary, so hopefully someone else can benefit as well... and I'll have record of what worked for me. I installed the Install python and R modules from the extension hub, and within that extension, I typed AER into the R field and clicked run - 



    ------------------------------
    Clint Cook
    ------------------------------