Search found 119 matches

Go to advanced search

by JonPedersen
Mon Dec 18, 2017 9:47 am
Forum: Coding SPSS syntax
Topic: Recode Variables with Text File Condition/Value List
Replies: 3
Views: 333

Re: Recode Variables with Text File Condition/Value List

Hi,
In case you have not found a solution:
Translate the CSV to a SPSS dataset
Sort your file with codes, as well as the new dataset (by the full ICD code).
use either match files or Star Join to match the code in the translation dataset to your full ICD codes.
Jon
by JonPedersen
Fri Dec 15, 2017 10:48 am
Forum: Coding SPSS syntax
Topic: Is there a rank over function in SPSS using SQL?
Replies: 3
Views: 123

Re: Is there a rank over function in SPSS using SQL?

Hi, In principle SPSS should support whatever is supported by the SQL-database in question for the select. (at least according to the vs 23 documentation for get capture and get data) But you may have a problem in your code: SELECT Distinct od.orderdate AS orderdate, od.country AS country, od.month ...
by JonPedersen
Fri Jun 02, 2017 7:00 am
Forum: Modifying SPSS output
Topic: Manage SPSS output; extracting ORs, HRs and 95% CI
Replies: 1
Views: 549

Re: Manage SPSS output; extracting ORs, HRs and 95% CI

Hi,
Yes it is. Look into the OMS. Basically, you save the results in a structured file, then extract what you need.
hth
Jon
by JonPedersen
Fri Jun 02, 2017 6:58 am
Forum: Coding SPSS syntax
Topic: 'include file 'doesn't work
Replies: 1
Views: 238

Re: 'include file 'doesn't work

Hi,
Difficult to know without seeing the file. But include is rather restrictive when it comes to syntax. You might try insert instead.
hth
Jon
by JonPedersen
Sun May 28, 2017 7:49 pm
Forum: Coding SPSS syntax
Topic: If Condition is Satisfied -> Multiple Variables/Conditions
Replies: 1
Views: 218

Re: If Condition is Satisfied -> Multiple Variables/Conditions

Hi, You are missing an "or" at the end of the first line. There are, however, several ways this can be achieved with somewhat less work. one is compute selvar=0. do repeat /x=Var1, Var2, Var3,Var4,Var5,Var6,Var7,Var8,Var9,Var10, Var11, Var12. if (x GE 'A40' ) and (x LE 'A45') selvar=1. end repeat. s...
by JonPedersen
Sun Apr 23, 2017 5:19 am
Forum: Coding SPSS syntax
Topic: Moving variable to front
Replies: 1
Views: 405

Re: Moving variable to front

Hi
You have to use save with keep and then order the variables in the way you want. Remember that you can use TO in variable lists
Best
Jon
by JonPedersen
Sun Apr 23, 2017 5:13 am
Forum: Modifying SPSS output
Topic: Graph output: PDF
Replies: 1
Views: 326

Re: Graph output: PDF

Hi
Use windows metafile if you want to export to word. It is not perfect but at least a vector format
Hth
Jon
by JonPedersen
Tue Feb 28, 2017 2:30 pm
Forum: General
Topic: automated recode data to 3 tertiles
Replies: 1
Views: 465

Re: automated recode data to 3 tertiles

Hi,
You can use the rank command.
rank VARIABLES=MyScores /ntiles(3) into MyTertiles.
hth
jon
by JonPedersen
Tue Sep 20, 2016 8:24 am
Forum: Coding SPSS syntax
Topic: Replace Missing variable values with non-blank value
Replies: 3
Views: 1192

Re: Replace Missing variable values with non-blank value

Hi, Basically, the first reference you found is correct, the second pertains to SAS, and SAS and SPSS lag functions behave differently (and SPSS does not have Retain). The code you need is: if missing(House#) House#=lag(House#). execute. can be done with point and click, but that would just be using...
by JonPedersen
Thu May 19, 2016 9:07 am
Forum: General
Topic: How to use the results in outputs to do other computation?
Replies: 2
Views: 417

Re: How to use the results in outputs to do other computation?

Hi, SPSS does not store the tables in an accessible way. You have basically three options: 1) use the OMS system, that can convert any result into a dataset. Extremely flexible, but a bit complex, and does not exist in very old versions. 2) Use aggregate (which, contrary to what you believe exist in...
by JonPedersen
Sun May 01, 2016 10:09 am
Forum: Coding SPSS syntax
Topic: Recoding with if statement
Replies: 2
Views: 364

Re: Recoding with if statement

Hi, Just use do if in stead of RECODE. i.e. DO IF (var1='banana'). DO IF var2=2. compute var3=1. ELSE IF Var2=1. compute Var2=2. ELSE. compute var3=var2. END IF. END IF. * In your particular case you can also do the somewhat more compact and opaque:. DO IF (var1='banana'). DO IF any(var2,1,2). compu...
by JonPedersen
Thu Apr 28, 2016 9:57 am
Forum: General
Topic: how to remove
Replies: 1
Views: 343

Re: how to remove

Hi Create a variable that is 1 if the case has one of your removal candidates (i.e. something like compute toberemoved=(Location= AICU) OR (Location=BICU).... use aggregate with addvariables and break ID onto sum up the number of toberemoved. Call the sum variable Remove. then simply do select if (R...
by JonPedersen
Fri Apr 01, 2016 4:34 pm
Forum: General
Topic: Ordinal regression HELP
Replies: 2
Views: 686

Re: Ordinal regression HELP

Hi, You only should use ordinal regression when your left hand variable (response) is ordinal. In your case it has only two values, so logistic regression should be used. The previous answer basically dealt with how to treat your independent variables, but that is not related to the choice between o...
by JonPedersen
Fri Apr 01, 2016 4:30 pm
Forum: General
Topic: SPSS Reporting more cases than there actually is
Replies: 3
Views: 971

Re: SPSS Reporting more cases than there actually is

Hi,
According to the screenshot, the weights are on. So Weights probably add up to your large number.
hth
Jon
by JonPedersen
Thu Nov 26, 2015 9:37 am
Forum: Coding SPSS syntax
Topic: Exporting tables with todays date in the name.
Replies: 5
Views: 1329

Re: Exporting tables with todays date in the name.

Hi, Well, you are nearly there. OMS is just like any other command, so it can be used with spss.Submit, so begin program python. import spss import datetime today=str(datetime.date.today()) spsscmd="""OMS /SELECT TABLES /IF COMMANDS=['CTables'] SUBTYPES=['Custom Table'] /DESTINATION FORMAT=XLSX OUTF...

cron