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,...
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.
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...
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...
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,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...
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...
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)....
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...
Look up the AGGREGATE command. AGGREGATE OUTFILE=* MODE=ADDVARIABLES /BREAK=ID /Count=N. ...
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...
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...
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.
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. ...
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...
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...
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) #...
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...
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.
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..."...
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...
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...
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....
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...
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...
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...
Convert the variable into a string before exporting it.
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...
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...
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
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...