correlation and regression for ordinal and nominal (dependent)

classic Classic list List threaded Threaded
32 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: correlation and regression for ordinal and nominal (dependent)

David Marso
Administrator
Simply swap the two variables (index1,trans1) in the IGraph syntax like so:

IGRAPH /VIEWNAME='Bar Chart' /X1 = VAR(index1) TYPE = CATEGORICAL /Y = $count
 /COLOR = VAR(trans1) TYPE = CATEGORICAL CLUSTER /COORDINATE = VERTICAL
 /X1LENGTH=6.0 /YLENGTH=6.0 /X2LENGTH=6.0 / CHARTLOOK='NONE'
 /CATORDER VAR(trans1) (ASCENDING VALUES OMITEMPTY)
 /BAR KEY=ON SHAPE = RECTANGLE  BASELINE = AUTO.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: correlation and regression for ordinal and nominal (dependent)

SiriusxTR
thanks I will try it. Until now it gives me error. I do not even know how to define the variable in syntax. Should I write the name of it which I have given or to write var08 as the 8th variable from the list in variable view, :)) Anyhow, thanks.
Reply | Threaded
Open this post in threaded view
|

Re: correlation and regression for ordinal and nominal (dependent)

David Marso
Administrator
Substitute your 8 variables in place of var01 var02 var03 var04 var05 var06 var07  var08.
The rest just keep as is.
VARSTOCASES  /MAKE trans1 FROM var01 var02 var03 var04 var05 var06 var07  var08
 /INDEX = Index1(trans1)
 /KEEP =  caseid
 /NULL = KEEP.

SiriusxTR wrote
thanks I will try it. Until now it gives me error. I do not even know how to define the variable in syntax. Should I write the name of it which I have given or to write var08 as the 8th variable from the list in variable view, :)) Anyhow, thanks.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: correlation and regression for ordinal and nominal (dependent)

John F Hall
In reply to this post by SiriusxTR

David Marso is right about syntax, but he didn’t explain that you can use PASTE to save the syntax generated by SPSS when you use the drop-down menus.  This auto-generated syntax can be quite complex, but sometimes you can use one or two lines to get the same result.  There are more than 400 pages of syntax-based tutorials on my site, but so far little or nothing on graphics.  

 

However I have an example for a simple chart I have sent you off-list.

 

For now, using syntax:

 

graph <statistic> by <var1> by <var2> .

 

From the drop-down menus, try, for example:

 

File > New > Syntax:

 

. . to open a new syntax file, then write (substituting your own variables:

 

graph <statistic> by <depvar> by <indvar> .                           [Don’t forget the full stop (period)!]  e.g.

 

GRAPH PCT BY OUTCOME BY ETHNIC .

 

. . and click on the green triangle or press [CTRL]+R to run the job.

 

 

Email:     [hidden email]

Website: www.surveyresearch.weebly.com

Skype:   surveyresearcher1

Phone:    (+33) (0) 2.33.45.91.47

 

 

 

 

 

Reply | Threaded
Open this post in threaded view
|

Re: correlation and regression for ordinal and nominal (dependent)

SiriusxTR
This post was updated on .
In reply to this post by David Marso
I changed the variable names to var01 var02 and so on.  Would the missing data cause trouble?I ran the script exactly but I get these errors:

Error for variables to cases:

Warnings
Text: caseid Command: VARSTOCASES
An undefined variable name, or a scratch or system variable was specified in a variable list which accepts only standard variables.  Check spelling and verify the existence of this variable.
This command not executed.

Error for crosstab

Warnings
Text: trans1 Command: CROSSTABS
An undefined variable name, or a scratch or system variable was specified in a variable list which accepts only standard variables.  Check spelling and verify the existence of this variable.
This command not executed.

Text: Index1 Command: CROSSTABS
An undefined variable name, or a scratch or system variable was specified in a variable list which accepts only standard variables.  Check spelling and verify the existence of this variable.


Error for interactive graph

Warnings
Variable index1 specified for keyword VAR of subcommand X1 does not exist in the working data file.
This command is not executed.


Reply | Threaded
Open this post in threaded view
|

Re: correlation and regression for ordinal and nominal (dependent)

ViAnn Beadle
What syntax did you run? Nobody can diagnose a problem without seeing the
syntax run and the context within which it was run. By context, I mean,
information about the variables in your file when the syntax is run
including their names and their format (string, number, date, ...).

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
SiriusxTR
Sent: Wednesday, February 15, 2012 2:17 PM
To: [hidden email]
Subject: Re: correlation and regression for ordinal and nominal (dependent)

I chenged the variable names to var01 var02 and so on. I ran the script
exactly but I get theese errors:

Error for variables to cases:

Warnings
Text: caseid Command: VARSTOCASES
An undefined variable name, or a scratch or system variable was specified in
a variable list which accepts only standard variables.  Check spelling and
verify the existence of this variable.
This command not executed.

Error for crosstab

Warnings
Text: trans1 Command: CROSSTABS
An undefined variable name, or a scratch or system variable was specified in
a variable list which accepts only standard variables.  Check spelling and
verify the existence of this variable.
This command not executed.

Text: Index1 Command: CROSSTABS
An undefined variable name, or a scratch or system variable was specified in
a variable list which accepts only standard variables.  Check spelling and
verify the existence of this variable.


Error for interactive graph

Warnings
Variable index1 specified for keyword VAR of subcommand X1 does not exist in
the working data file.
This command is not executed.




--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/correlation-and-regression-for
-ordinal-and-nominal-dependent-tp5471812p5487452.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command SIGNOFF SPSSX-L For a list of
commands to manage subscriptions, send the command INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: correlation and regression for ordinal and nominal (dependent)

SiriusxTR
This post was updated on .
I ran this syntax: (I PUT AN ASTERISK IN FRONT OF LABEL BECAUSE i have already labeled the variables. variables are numeric, ordinal.

FREQ var01 TO var09.
VARSTOCASES /MAKE trans1 FROM var01 var02 var03 var04 var05 var06 var07 var08 var09
 /INDEX = Index1(trans1)
 /KEEP = caseid
 /NULL = KEEP.
*VALUE LABELS trans1
 1 "category 1" 2 "category 2" 3 "category 3" 4 "category 4" .
CROSSTABS TABLE trans1 BY Index1.

IGRAPH /VIEWNAME='Bar Chart' /X1 = VAR(index1) TYPE = CATEGORICAL /Y = $count
 /COLOR = VAR(trans1) TYPE = CATEGORICAL CLUSTER /COORDINATE = VERTICAL
 /X1LENGTH=6.0 /YLENGTH=6.0 /X2LENGTH=6.0 / CHARTLOOK='NONE'
 /CATORDER VAR(trans1) (ASCENDING VALUES OMITEMPTY)
 /BAR KEY=ON SHAPE = RECTANGLE BASELINE = AUTO.
Reply | Threaded
Open this post in threaded view
|

Re: correlation and regression for ordinal and nominal (dependent)

SiriusxTR
Ok, ViAnn corrected me and here is the working syntax:
I have only one question: how do i make the variables not to dissappear after using this syntax? I create 2 new but i delete the 9 original variables.


FREQ var01 TO var09.
VARSTOCASES  /MAKE trans1 FROM var01 var02 var03 var04 var05 var06 var07 var08 var09
 /INDEX = Index1(trans1)
 /NULL = KEEP.

CROSSTABS TABLE trans1 BY Index1.
 
IGRAPH /VIEWNAME='Bar Chart' /X1 = VAR(index1) TYPE = CATEGORICAL /Y = $count
 /COLOR = VAR(trans1) TYPE = CATEGORICAL CLUSTER /COORDINATE = VERTICAL
 /X1LENGTH=6.0 /YLENGTH=6.0 /X2LENGTH=6.0 / CHARTLOOK='NONE'
 /CATORDER VAR(trans1) (ASCENDING VALUES OMITEMPTY)
 /BAR KEY=ON SHAPE = RECTANGLE  BASELINE = AUTO.


Reply | Threaded
Open this post in threaded view
|

Re: correlation and regression for ordinal and nominal (dependent)

David Marso
Administrator
"I have only one question: how do i make the variables not to dissappear after using this syntax? I create 2 new but i delete the 9 original variables. "

This question is meaningless in the current context!
You have reshaped the data from 1 row to 8 rows per case (not including the missing values).  After running VARSTOCASES you will need to reopen your original data file.
I assume you have SAVED it after initial preparation.
And you *may* at some point want to crack the manual so you have a context for understanding any answers you may receive to future queries on this group.
--
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: correlation and regression for ordinal and nominal (dependent)

SiriusxTR
This post was updated on .
Yes, of course, I saved it. And yes, I know I am incapable to understand these syntax procedures and commands, but in the last two weeks I read a huge amount of information regarding statistics in general and SPSS from about 20-40 different sources and my conclusion is that there is not a single manual which would be appropriate for me to understand easily. I am not dumb, but the manuals are too axed on mathematics OR contain data which are not correct OR they simplify OR they do not contain all the information. Everyone has a different oppinion, there is little consensus. I would need two good books. One for syntax explained as it was for Turbo Pascal and one for SPSS which has answers for the problematic questions. On the net there is a huge amount of information about the basics, which, thank you very much I can figure out by myself. But for the juicy part I have to spend 3-5 hours on the net to figure it out, reading and collecting data from forums. I watched how powerfull is the syntax, I like it, but I need to learn it from the basics. When you learn a new language you start with colours, numbers and family, not by advanced syntax for graphics. Try to learn Hungarian in 2 weeks.:))
Anyway, thank you all for your help, I learned some things, and now I have a working syntax which I can use in the future.
Next I have to figure out the binomial regression thing and why is it not working for me.
One other thing: to do statistics, it is very hard without understanding the mathematical concepts. And here is my biggest problem.:))
Reply | Threaded
Open this post in threaded view
|

Re: correlation and regression for ordinal and nominal (dependent)

David Marso
Administrator
http://www-01.ibm.com/support/docview.wss?uid=swg27021213#en

ftp://public.dhe.ibm.com/software/analytics/spss/documentation/statistics/20.0/en/client/Manuals/IBM_SPSS_Statistics_Command_Syntax_Reference.pdf
ftp://public.dhe.ibm.com/software/analytics/spss/documentation/statistics/20.0/en/client/Manuals/IBM_SPSS_Statistics_Core_System_Users_Guide.pdf
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: correlation and regression for ordinal and nominal (dependent)

SiriusxTR
Thanks, by the way what is the general oppinion about "Andy Field - Discovering statistics using SPSS"?
12