Showing posts with label SPSS. Show all posts
Showing posts with label SPSS. Show all posts

Wednesday, September 26, 2018

How do you read a SPSS file using R?

SPSS files are created using the SPSS software from IBM. You could read these files using R provided you can install the 'haven' library from one of the CRAN sites.


Rlib_Haven.png


Install 'haven'
--------------
> install.packages("haven")
Warning in install.packages("haven") :
  'lib = "C:/Program Files/Microsoft/R Client/R_SERVER/library"' is not writable
also installing the dependencies ‘assertthat’, ‘lazyeval’, ‘Rcpp’, ‘readr’, ‘hms’, ‘tibble’, ‘BH’

trying URL 'https://mran.revolutionanalytics.com/snapshot/2016-11-01/bin/windows/contrib/3.3/assertthat_0.1.zip'
Content type 'application/zip' length 44884 bytes (43 KB)
downloaded 43 KB

trying URL 'https://mran.revolutionanalytics.com/snapshot/2016-11-01/bin/windows/contrib/3.3/lazyeval_0.2.0.zip'
Content type 'application/zip' length 137793 bytes (134 KB)
downloaded 134 KB

trying URL 'https://mran.revolutionanalytics.com/snapshot/2016-11-01/bin/windows/contrib/3.3/Rcpp_0.12.7.zip'
Content type 'application/zip' length 3265183 bytes (3.1 MB)
downloaded 3.1 MB

trying URL 'https://mran.revolutionanalytics.com/snapshot/2016-11-01/bin/windows/contrib/3.3/readr_1.0.0.zip'
Content type 'application/zip' length 1167814 bytes (1.1 MB)
downloaded 1.1 MB

trying URL 'https://mran.revolutionanalytics.com/snapshot/2016-11-01/bin/windows/contrib/3.3/hms_0.2.zip'
Content type 'application/zip' length 20730 bytes (20 KB)
downloaded 20 KB

trying URL 'https://mran.revolutionanalytics.com/snapshot/2016-11-01/bin/windows/contrib/3.3/tibble_1.2.zip'
Content type 'application/zip' length 614069 bytes (599 KB)
downloaded 599 KB

trying URL 'https://mran.revolutionanalytics.com/snapshot/2016-11-01/bin/windows/contrib/3.3/BH_1.60.0-2.zip'
Content type 'application/zip' length 15529292 bytes (14.8 MB)
downloaded 14.8 MB

trying URL 'https://mran.revolutionanalytics.com/snapshot/2016-11-01/bin/windows/contrib/3.3/haven_1.0.0.zip'
Content type 'application/zip' length 800532 bytes (781 KB)
downloaded 781 KB

package ‘assertthat’ successfully unpacked and MD5 sums checked
package ‘lazyeval’ successfully unpacked and MD5 sums checked
package ‘Rcpp’ successfully unpacked and MD5 sums checked
package ‘readr’ successfully unpacked and MD5 sums checked
package ‘hms’ successfully unpacked and MD5 sums checked
package ‘tibble’ successfully unpacked and MD5 sums checked
package ‘BH’ successfully unpacked and MD5 sums checked
package ‘haven’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\TEMP.HODENTEK9.000.001.002\AppData\Local\Temp\Rtmp84xjOn\downloaded_p

-----
Load the library
> library(haven)
-------------
I will try to read a file called 'employees.sav' which I downloaded to my laptop from internet here :

(https://www.spss-tutorials.com/spss-opening-data-with-syntax/).

Now I run this statment in R (Microsoft Client R.GUI)


Rlib_Haven_1

That's all folks!

Is SPSS software free?


You could the free version for 14 days. The free version also has the following Add-ons.

Custom Tables & Advanced Statistics Users
Custom Tables and Advanced Statistics Add-on provides easy to use drag and drop interactive tables exportable to Microsoft/PDF. You can access a variety of additional techniques such as; Non-linear, logistic, 2-stage least squares regression, Generalized linear modeling and survival analysis. Additionally, Bayesian Statistics now available.
Complex Sampling & Testing Users
Complex Sampling and Testing Add-on provides functionality for small sample sizes, missing data , and complex sampling. You can access regression with optimal scaling including lasso and elastic net. Additional features include; categorical principal components analysis, multidimensional scaling and unfolding, and multiple correspondence analysis.
Forecasting & Decision Trees Users
Forecasting and Decision Trees Add-on provides ARIMA and exponential smoothing forecasting capabilities. Classification and decision trees based on four established tree-growing algorithms are also available. You can also create neural network predictive models as well as RFM analysis to test marketing campaigns.

Each of the add-ons costs $79.00

Go to this link and fill out the form for free download:
https://www.ibm.com/account/reg/us-en/signup?formid=urx-19774

Sunday, September 23, 2018

What is SPSS?

Data Science is trending. What with Machine Learning and Artificial Intelligence, learning to work with statistical analysis tools will take you far.

Here is an IBM one liner for SPSS:

"Propel research & analysis with a fast and powerful solution"

SPSS is an acronym for Statistical Software for Social Sciences. Its beginnings dates back to 1968 and it was acquired by IBM in 2009. Files created by this software have the extension .sav. SPSS outputs tables and charts that can processed by MS Word, Google Docs, Open Office, etc.

SPSS can be used for editing and analyzing data similar to other software such as R, Excel, Python, etc.

Here is a PR demo from IBM




More SPSS stuff here:

https://hodentekhelp.blogspot.com/2018/09/is-spss-software-free.html

https://hodentekhelp.blogspot.com/2018/09/how-do-you-read-spss-file-using-r.html