Menu
  • HOME
  • TAGS

Automating IBM SPSS Data Collection survey export?

python,sql-server,ibm,spss

This isn't as clean as working directly with whatever database is holding the data, but you could do something with an exported data set: There may or may not be a way for you to write and run an export script from inside your Admin panel or whatever. If not,...

How can I download SPSS for macbook?

spss,macbookpro

There are short-term trial versions, and there are inexpensive academic versions, but you would be violating the license agreement to try and use a cracked version.

How are numeric and string variables determined in SPSS?

python,python-2.7,python-3.x,spss

If you take note of the print output generated from the code below, you'll notice that string variables are "exported" to strings (not surprisingly) and numeric variables are converted/exported to floats. Date variables however are also converted to floats, with the date represented as the number of seconds that have...

SPSS: Use index variable inside quotation marks

loops,indexing,spss,quotation-marks

You can't use VECTOR in this way i.e. using GET command within a VECTOR/LOOP loop. However you can use DEFINE/!ENDDEFINE. This is SPSS's native macro facility language, if you are not aware of this, you'll most likely need to do a lot of reading on it and understand it's syntax...

How to Import Data from excel to SPSS

excel,data,import,spss

Yes. So when you import data via GUI File-->Open-->Data-->Select Excel Data file You will be presented with the following GUI: (EDIT: Image upload doesn't seem to be working?!) https://www.dropbox.com/s/ni2jdjs36lxwb16/SOImportExcelToSPSSRangeGUI.bmp?dl=0 Where you can see the "Range" option which allows you to manually enter a continuous range to select the data from...

Average Effectiveness of Variables in Binary Logistic Model

average,regression,effect,spss,coefficients

If you test an interaction hypothesis, you have to include a number of terms in your model. In this case, you would have to include: Base effect of price Base effects of brands (dummies) Interaction effects of brand dummies * price. Since you have 5 brands, you will have to...

dynamically create variable names in loops - SPSS

spss

You are mistakenly trying to use SPSS's macro language (DEFINE / !ENDDEFINE) in normal SPSS syntax i.e. !concat works only when used in the body of a SPSS macro. Here is a solution non-python solution using DEFINE/!ENDDEFINE: But which requires the input of the names. /*** ############################## ***/. DATA LIST...

How do I programmatically merge cases from datasets with conflicting variable names?

spss

This occurs because variables of the same name in the two different data sources have either different format types (STRING, NUMERIC, DATE ect) or either they are both STRINGS but of different length. The latter, string variables of different lenghts, can be solved like this: DATA LIST FREE / V(A1)....

combine compute, loop and concat

macros,spss

CONCAT is a function for manipulating the values of string variables. So you can't use it for defining a variable name. However you can make use of the !CONCAT function inside of a SPSS macro. You can use the following macro to recode a set of variables. DEFINE !recodeVars (vars...

Count repeated values in variable and add results to a new one in SPSS

spss

Look up the AGGREGATE command. AGGREGATE OUTFILE=* MODE=ADDVARIABLES /BREAK=ID /Count=N. ...

Graphs in a loop in SPSS

spss

Macros are not supported with GPL, because the GPL syntax doesn't follow standard SPSS Statistics syntax and macro expansion would be unreliable. Sometimes it would work, but Python programmability is the appropriate mechanism for this. A demonstration on how to do this can be found here...

Storing applicative version info in SPSS sav file

spss

There is a header field in the sav file that identifies the creator. However, that would be overwritten if the file is resaved. It would be visible with commands such as sysfile info. Another approach would be to create a custom file attribute using a name that is unlikely to...

Save Outfile with Python Loop in SPSS

python,for-loop,save,spss,file-io

In your save call, you are not resolving filename to its actual value. It should be something like this: spss.Submit("""save outfile="%s".""" % filename)

Export SPSS output in a meaningful format (e.g. csv, tab)?

excel,csv,export,output,spss

Once in Excel you can use Text to Columns with space as the delimiter to parse the single cells into multiple cells. Having done so you might choose to save the result as character separated values, should you prefer the .csv format.

Creating a dummy variable from a string variable

spss

COMPUTE Q1_d=LENGTH(Q1)>0. Which will create dichotomous 0/1 variable Q1_d. If row case data at Q1 has data/characters then a 1 (one) will be assigned at Q1_d else if Q1 equals an empty string then 0 (zero) will be assigned. ...

Cannot get ExportTablesToExcelFiles.wwd script to work properly with PASW 18 (SPSS) and Excel 2013

vba,table,export,spss

The script does export all, all visible, or selected tables according to the radio button you choose. Whether you get xls or xlsx files depends on which version of Excel you have installed, since it uses Excel VBA automation. As a practical matter, xls files work fine in later versions...

Can't run k-means with SPSS Modeler 16

k-means,spss

You will need to instantiate the input fields used by the k-means model. You do this by adding a 'Type' node before the modeling node and after any field operation node that would make compute or change any of the nodes that are used as input to the model. In...

Check valid values of likert scales in R

r,spss

A quick solution would be (assuming your data called df) lapply(df, function(x) which(!x %in% seq_len(5))) Or if you want to create a custom function, could try Validfunc <- function(x){ l <- lapply(x, function(y) which(!y %in% seq_len(5))) Filter(Negate(function(...) length(...) == 0), l) } And then use it as in Validfunc(df) #...

SPSS syntax - use path of the file

syntax,path,spss

You can get the relative path of a SPSS syntax (provided it is saved) using python. SpssClient.GetDesignatedSyntaxDoc().GetDocumentPath() From this you can then navigate to whichever folder you desire using pythons' os module (or otherwise). Below is an example of retrieving the saved file location of the syntax and then also...

SPSS syntax to convert all date variables into strings

variables,type-conversion,spss

ALTER TYPE can select variables based on their format and convert to strings, so just specify the input and output formats without a list of variable names.

Non-ASCII characters in R, reading from .sav file

r,character-encoding,spss,non-ascii-chars

Can you just set the encoding once you've read the data in? # Here's your sentence s <- "\302\277Qu\303\251 calificaci\303\263n le dar\303\255a..." # it has no encoding Encoding(s) # [1] "unknown" # but if you specify UTF-8, then it shows up correctly iconv(s, 'UTF-8') # [1] "¿Qué calificación le daría..."...

How to use STATS_GETR extension command in SPSS [closed]

r,spss

The extension command actually has a helper subcommand INFO to help with that problem. So here is an example running it on an RData file I created that is simply the saved workspace of MyDF <- data.frame(cbind(rnorm(100),rnorm(100))). STATS GET R FILE="C:\Users\andrew.wheeler\Desktop\test\Examp.RData" /INFO. Note the workspace is the RData file. So...

How to plot a linegraph in SPSS with respect to the data?

data-visualization,spss

Here is an example, for the line element you need to specify the option missing.gap() - I thought just deleting missing.wings() from the default code would work but maybe it is an internal default. You may want to consider changing Time_Period_Hours to a scale variable and doing the aggregation outside...

Fill blank variable with subsequent values

spss

Look up VECTOR / LOOP examples. DATA LIST FREE / ID CH13 CH14 CH13U CH14U. BEGIN DATA. 1 -1 13 -1 -1 2 30 30 -1 -1 3 -1 -1 15 16 4 -1 5 6 7 END DATA. DATASET NAME DSRaw. RECODE ALL (-1=SYSMIS). VECTOR V= CH14 TO CH14U....

Can't find variable using GetValueChar

python,spss

I don't see a call to GetValueChar, and there is no such api, but one possibility is that variable names in the Python apis are case sensitive. Are you sure that you have matched the case? You might want to try running the spss.Cursor class examples in the Python programmability...

Opening Files with Loop in Python/SPSS

python,loops,for-loop,concatenation,spss

Update: I ended up going with this: begin program. import spss, spssaux import os schoollist = ['brow'] for x in schoollist: school = 'brow' school2 = school + '06.sav' #opens the file filename = os.path.join("Y:\...\Data", school2) #In this instance, Y:\...\Data\brow06.sav spssaux.OpenDataFile(filename) #creates the variable cur=spss.Cursor(accessType='w') cur.SetVarNameAndType(['name'],[8]) cur.CommitDictionary() for i in...

Opening .spo SPSS file in R

r,spss

Those .spo files are output files generated by SPSS. They might contain code, tables and graphics. I'm not aware of any R package that might open them. However, the open source SPSS clone PSPP (http://www.gnu.org/software/pspp/) does usually open them. There also used to exist an SPSS Legacy Viewer software that...

How to export a date and time column properly from SPSS into csv

csv,export-to-csv,spss

Convert the variable into a string before exporting it.

SPSS Macro to create new variable based on 2 existing variables

macros,spss

One important thing, you should know about SPSS macros is, that the SPSS macro language is just a "string parser". This means, the text within a DEFINE !ENDDEFINE block is parsed and as an output a syntax code will be created. The variables (beginning with "!") will be substituted by...

How to create a new table based on combination of two cells based on a third?

database,r,excel,spss,gephi

You might not asked for a solution in R, but using SPSS for this problem would be quite painfull (if possible at all). Let's assume you have a csv-file (Conference-Participants.csv) which looks like this: Conference,Participant UN Conference 1945,John UN Conference 1945,Jack UN Conference 1945,Jamie UN Conference 1945,Pablo UN Conference Kyoto...

SPSS Frequency Plot Complication

spss

I think what you are looking for CTABLES. It can do parallel columns of frequencies, and it includes a column proportions test that can see whether the distributions differ

Convert .rdata to .sas7bdat or .sav [closed]

r,sas,spss

If you want to use this in SPSS, consider using the STATS_GETR extension command. It can read R workspace or data files and map appropriate elements directly to an SPSS dataset. This extension command is available from the SPSS Community (www.ibm.com/developerworks/spssdevcentral) website or, for Statistics 22, it can be installed...