spss

How to preserve Labels when SPSS file (.sav) imported into pandas via rpy?

时光毁灭记忆、已成空白 提交于 2019-12-22 04:33:29
问题 I'm looking to work on a SPSS files (.sav) using pandas . In the absence of the SPSS program, here's what a typical file looks like when converted to .csv: On investigation into what the first two rows signify (I don't know SPSS), it seems that the first row contains the Label s, while the second row contains the VarName s. When I bring the file into pandas thus: import pandas.rpy.common as com def savtocsv(filename): w = com.robj.r('foreign::read.spss("%s", to.data.frame=TRUE)' % filename) w

how to connect SPSS with mongodb

北战南征 提交于 2019-12-21 06:16:48
问题 I have mongodb where my data is stored. I am using SPSS where I have do some data analysis. Can someone help me in connecting SPSS to mongodb. Thank you. 回答1: Are you using SPSS Modeler or Statistics? In both cases you can access MongoDB using R. Both Statistics and Modeler have integration with R. So you can just use the R package 'rmongodb' and connect to your MongoDB. Here you have some links: https://docs.compose.io/languages/r.html http://www.r-bloggers.com/r-and-mongodb/ Remember to use

In SPSS, is it possible to export a dataset file to .CSV with the value names instead of the value numbers?

☆樱花仙子☆ 提交于 2019-12-21 04:38:29
问题 In my SPSS file, I have a variable called "X". It has four values: 1="dog", 2="cat", 3="hyena", 4="parrot". If I export my data to a .CSV file, here's what it looks like: X 1 2 3 4 I want the exported .CSV to look like this: X dog cat hyena parrot is this possible? 回答1: Yes, it is possible (at least in SPSS 20). In File Menu, choose, "Save As...", in the drop down menu in the dialog box that opens choose "Save as type: 'Comma delimited (*.csv)')", and underneath that select "Save value labels

Performance reading large SPSS file in pandas dataframe on Windows 7 (x64)

假装没事ソ 提交于 2019-12-21 03:01:23
问题 I have a large SPSS-file (containing a little over 1 million records, with a little under 150 columns) that I want to convert to a Pandas DataFrame. It takes a few minutes to convert the file to a list, than another couple of minutes to convert it to a dataframe, than another few minutes to set the columnheaders. Are there any optimizations possible, that I'm missing? import pandas as pd import numpy as np import savReaderWriter as spss raw_data = spss.SavReader('largefile.sav', returnHeader

SPSS and PHP/MySQL Integration

ⅰ亾dé卋堺 提交于 2019-12-20 21:41:17
问题 I apologize up front for the broadness of this question, but I'm wondering if anyone has any suggestions/pointers. A friend's company uses SPSS for statistical data, surveys, etc. They'd like to be able to slice and dice the info via a web interface. I have no knowledge of SPSS, so there may be a simple web front end, but being a PHP/MySQL guy, I wondered if SPSS data can be exported in a way that MySQL can import or PHP can parse. Then I could build an AJAX front end to return queries in

weight data with R Part II

泪湿孤枕 提交于 2019-12-20 16:42:43
问题 Given is the following data frame: structure(list(UH6401 = c(1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1), UH6402 = c(1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0

Different results Gamma generalized linear model R and SPSS

柔情痞子 提交于 2019-12-20 06:04:31
问题 Update: The p-values and S.E.'s are similar between SPSS and R if I change the parameter estimation method in SPSS to 'Hybrid' and the scale parameter method to 'Pearson Chi-square'. Does anyone now how to change these settings in R and what these settings actually mean? I am trying to perform an GLM with a gamma log link function in R, to analyse a multiple imputation dataset. However, when I compare the results from the same analysis in R and SPSS they are very different. This example is in

Library (dylib) not loaded - image not found - Python IDE

风格不统一 提交于 2019-12-20 02:57:08
问题 Basically I'm trying to run some Python code from savReaderWriter module in order to create a .sav file ready to open in IBM SPSS. As a macOS user I needed to run these two lines in the terminal first for the module to work: echo 'export DYLD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/savReaderWriter/spssio/macos' >> ~/.bash_profile echo 'export LC_ALL=en_US.UTF-8' >> ~/.bash_profile Below you can see a piece of code I'm trying to run in Python:

SPSS syntax - use path of the file

Deadly 提交于 2019-12-18 07:00:09
问题 I have a bunch of SPSS data and syntax files which I am moving around, changing folders on a daily basis. However, the relative paths remains the same. Is there a way to make use of this fact? e.g.: use the INCLUDE command and reference a syntax file which is always one path level up; or use GET to open a file, located two levels UP Googling around I found some reference to the HOST command, but I did not quite make it to work. Any input would be appreciated :) Thanks a lot in advance 回答1:

How to open spss data files in excel?

旧时模样 提交于 2019-12-17 23:27:06
问题 I want to open spss .sav data files in excel without open the spss files(i don't want to convert spss data file into excel file), I know this is possible using OLDB connection, but i don't know how to do this. Can anyone help me to do this? Thanks in advance. 回答1: I converted sav to csv online: http://pspp.benpfaff.org/ 回答2: In order to download that driver you must have a license to SPSS. For those who do not, there is an open source tool that is very much like SPSS and will allow you to