SPSS Macro Variables

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

SPSS Macro Variables

Michael W. Bates
Hi,

I need some help with SPSS code.  I’m a 10 year SAS user who’s fairly new
to SPSS.  I and importing 5 excel files with dates in the filename, and
would like to be able to change the date once in my code and import all 5
files.

Currently, here’s what I have:

define !import1 () 'D:\Reports\Daily\Production File 1 Nov 16 2009.xls' !
enddefine.
define !import2 () 'D:\Reports\Daily\Production File 2 Nov 16 2009.xls' !
enddefine.
define !import3 () 'D:\Reports\Daily\Production File 3 Nov 16 2009.xls' !
enddefine.
define !import4 () 'D:\Reports\Daily\Production File 4 Nov 16 2009.xls' !
enddefine.
define !import5 () 'D:\Reports\Daily\Production File 5 Nov 16 2009.xls' !
enddefine.

What I would like to do is be able to define the “Nov 16” once and
concatenate that with the rest of the macro variables, so I don’t have to
make 5 changes.  SPSS doesn’t seem to like it when I try to define a
separate macro variable for the “Nov 16” and then concatenate it onto the
rest of the information in the macro variable.  Any suggestions.

Thanks,

Mike Bates
[hidden email]

=====================
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: SPSS Macro Variables

Bruce Weaver
Administrator
Michael W. Bates wrote
Hi,

I need some help with SPSS code.  I’m a 10 year SAS user who’s fairly new
to SPSS.  I and importing 5 excel files with dates in the filename, and
would like to be able to change the date once in my code and import all 5
files.

Currently, here’s what I have:

define !import1 () 'D:\Reports\Daily\Production File 1 Nov 16 2009.xls' !
enddefine.
define !import2 () 'D:\Reports\Daily\Production File 2 Nov 16 2009.xls' !
enddefine.
define !import3 () 'D:\Reports\Daily\Production File 3 Nov 16 2009.xls' !
enddefine.
define !import4 () 'D:\Reports\Daily\Production File 4 Nov 16 2009.xls' !
enddefine.
define !import5 () 'D:\Reports\Daily\Production File 5 Nov 16 2009.xls' !
enddefine.

What I would like to do is be able to define the “Nov 16” once and
concatenate that with the rest of the macro variables, so I don’t have to
make 5 changes.  SPSS doesn’t seem to like it when I try to define a
separate macro variable for the “Nov 16” and then concatenate it onto the
rest of the information in the macro variable.  Any suggestions.

Thanks,

Mike Bates
Hi Mike.  Please show how you are you using your !import macros later on.  There may be a more efficient way to do that.  I'm wondering if something along these lines might be better, for example.


define !date () ' Nov 16 2009.xls' !enddefine.
define !root () 'C:\Temp\Production File ' !enddefine.

define !import (FileNo = !tokens(1))

!let !f = !quote(!FileNo)
!let !d = !concat('DataSet', !unquote(!f))

GET DATA
  /TYPE=XLS
  /FILE= !root + !f + !date
  /SHEET=name 'Sheet1'
  /CELLRANGE=full
  /READNAMES=on
  /ASSUMEDSTRWIDTH=32767.
DATASET NAME !d WINDOW=FRONT.

!enddefine.


*set mprint on. /* Uncomment when testing the macro.
!import FileNo = 1.
!import FileNo = 2.
*set mprint off. /* Uncomment when testing the macro.

--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Can Classification Tree be used on Multiple response variables?

Jarrod Teo-2

Hi,

I will like to know if Classification Tree like CHAID be used on Multiple response variables? This is because I have saw a friend using it in her research.

Thanks.
Dorraj


Windows 7: Find the right PC for you. Learn more.
Reply | Threaded
Open this post in threaded view
|

Re: Can Classification Tree be used on Multiple response variables?

ViAnn Beadle

I think we need more information here. You could include multiple dichotomy variables but each variable will be evaluated separately.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of DorraJ Oet
Sent: Monday, November 16, 2009 6:42 PM
To: [hidden email]
Subject: Can Classification Tree be used on Multiple response variables?

 


Hi,

I will like to know if Classification Tree like CHAID be used on Multiple response variables? This is because I have saw a friend using it in her research.

Thanks.
Dorraj


Windows 7: Find the right PC for you. Learn more.

Reply | Threaded
Open this post in threaded view
|

Re: SPSS Macro Variables

Bob Walker-2
In reply to this post by Michael W. Bates
Hey Mike,

For those of us who regularly use macros, it's a love hate relationship, because it can be quirky. I run into your situation often when working with files that share root names or directories,

I've pasted some syntax below that shows one way to address your issue. Instead of using excel files, I use DATASET, since these are limited to the active session. Brush up on the !QUOTE, !UNQUOTE, and !CONCAT keywords in the DEFINE-!ENDDEFINE section of the syntax command reference. Below, I just add 4 files to show how a loop might work...

PRESERVE.
SET MPRINT ON MEXPAND ON.
DATASET CLOSE ALL.
DATA LIST FREE /var1 to var10.
BEGIN DATA
9,8,27,78,01,9,8,9,9,8
10,9,21,12,11,7,7,6,5,4
11,2,44,100,900,3,3,2,2,7
12,4,53,38,8,4,4,4,4,4
END DATA.
DATASET NAME Production_File_1_Nov16_2009 WINDOW=FRONT.
DATASET COPY Production_File_2_Nov16_2009 WINDOW=FRONT.
DATASET COPY Production_File_3_Nov16_2009 WINDOW=FRONT.
DATASET COPY Production_File_4_Nov16_2009 WINDOW=FRONT.

DEFINE !EXAMPLE()

ADD FILES
!DO !Z = 1 !TO 4
/FILE = !CONCAT("Production_File_",!Z,"_Nov16_2009")
!DOEND.
EXECUTE.

!ENDDEFINE.
!EXAMPLE.

RESTORE.
DATASET CLOSE ALL.

HTH,

Bob Walker
Surveys & Forecasts, LLC

----- Original Message -----
From: "Michael W. Bates"
Date: Monday, November 16, 2009 4:03 pm
Subject: SPSS Macro Variables
To: [hidden email]

> Hi,
>
> I need some help with SPSS code. I’m a 10 year SAS user
> who’s fairly new
> to SPSS. I and importing 5 excel files with dates in the
> filename, and
> would like to be able to change the date once in my code and
> import all 5
> files.
>
> Currently, here’s what I have:
>
> define !import1 () 'D:\Reports\Daily\Production File 1 Nov 16
> 2009.xls' !
> enddefine.
> define !import2 () 'D:\Reports\Daily\Production File 2 Nov 16
> 2009.xls' !
> enddefine.
> define !import3 () 'D:\Reports\Daily\Production File 3 Nov 16
> 2009.xls' !
> enddefine.
> define !import4 () 'D:\Reports\Daily\Production File 4 Nov 16
> 2009.xls' !
> enddefine.
> define !import5 () 'D:\Reports\Daily\Production File 5 Nov 16
> 2009.xls' !
> enddefine.
>
> What I would like to do is be able to define the “Nov 16”
> once and
> concatenate that with the rest of the macro variables, so I
> don’t have to
> make 5 changes. SPSS doesn’t seem to like it when I try to
> define a
> separate macro variable for the “Nov 16” and then
> concatenate it onto the
> rest of the information in the macro variable. Any suggestions.
>
> Thanks,
>
> Mike Bates
> [hidden email]
>
> =====================
> 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
>

Bob Walker
Surveys & Forecasts, LLC
www.safllc.com


Reply | Threaded
Open this post in threaded view
|

Re: Can Classification Tree be used on Multiple response variables?

Jarrod Teo-2
In reply to this post by ViAnn Beadle
Hi,

Basically this is a sample of my data and my question is that "What do you really like about our product?"

prod    Design     Sound      Storage
A         1             0            1
A         1             0            0
B         1             0            1
C         1             1 &n! bsp;          1
C         0             1            1

So as an example, in red, the first participant said something about that they like the design and storage of their product.

1 means say something
0 means say nothing about it

Can I use classification tree then to find out the profile of those people buying product A, B and C?


Date: Mon, 16 Nov 2009 19:25:59 -0700
From: [hidden email]
Subject: Re: Can Classification Tree be used on Multiple response variables?
To: [hidden email]

I think we need more information here. You could include multiple dichotomy variables but each variable will be evaluated separately.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of DorraJ Oet
Sent: Monday, November 16, 2009 6:42 PM
To: [hidden email]
Subject: Can Classification Tree be used on Multiple response variables?

 


Hi,

I will like to know if Classification Tree like CHAID be used on Multiple response variables? This is because I have saw a friend using it in her research.

Thanks.
Dorraj


Windows 7: Find the right PC for you. Learn more.



Windows 7: Find the right PC for you. Learn more.
Reply | Threaded
Open this post in threaded view
|

Re: Can Classification Tree be used on Multiple response variables?

ViAnn Beadle

What’s the definition of a case here. Is it a person or a product?

 

From: DorraJ Oet [mailto:[hidden email]]
Sent: Monday, November 16, 2009 11:36 PM
To: [hidden email]; SPSS Syntax help
Subject: RE: Can Classification Tree be used on Multiple response variables?

 

Hi,

Basically this is a sample of my data and my question is that "What do you really like about our product?"

prod    Design     Sound      Storage
A         1             0            1
A         1             0            0
B         1             0            1
C         1             1            1
C         0             1            1

So as an example, in red, the first participant said something about that they like the design and storage of their product.

1 means say something
0 means say nothing about it

Can I use classification tree then to find out the profile of those people buying product A, B and C?


Date: Mon, 16 Nov 2009 19:25:59 -0700
From: [hidden email]
Subject: Re: Can Classification Tree be used on Multiple response variables?
To: [hidden email]

I think we need more information here. You could include multiple dichotomy variables but each variable will be evaluated separately.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of DorraJ Oet
Sent: Monday, November 16, 2009 6:42 PM
To: [hidden email]
Subject: Can Classification Tree be used on Multiple response variables?

 


Hi,

I will like to know if Classification Tree like CHAID be used on Multiple response variables? This is because I have saw a friend using it in her research.

Thanks.
Dorraj


Windows 7: Find the right PC for you. Learn more.

 


Windows 7: Find the right PC for you. Learn more.

Reply | Threaded
Open this post in threaded view
|

Re: SPSS Macro Variables

Richard Ristow
In reply to this post by Michael W. Bates
At 03:21 PM 11/16/2009, Michael W. Bates wrote:

>I'm a 10 year SAS user who's fairly new to SPSS.  I and importing 5
>excel files with dates in the filename, and would like to be able to
>change the date once in my code and import all 5 files.
>
>define !import1 () 'D:\Reports\Daily\Production File 1 Nov 16 2009.xls' !
>enddefine.
>
>I would like to the 'Nov 16' once and concatenate that with the rest
>of the macro variables, so I don't have to make 5 changes.  SPSS
>doesn't seem to like it when I try to define a separate macro
>variable for the 'Nov 16'.

OK, here's the shock for SAS macro users:
a) You can't create or assign a value to a macro variable except within a macro
b) Macro variables do not persist after the macro they belong to.
They are not available in another macro.

The standard SPSS solution is to make the date string an argument to
the macro. I'd love to work that out, and may in a bit, but I'm both
rusty and pressed for time.

-Best of luck,
  Richard

=====================
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: SPSS Macro Variables

Jon K Peck

See below.
Jon Peck
SPSS, an IBM Company
[hidden email]
312-651-3435



From: Richard Ristow <[hidden email]>
To: [hidden email]
Date: 11/17/2009 01:57 PM
Subject: Re: [SPSSX-L] SPSS Macro Variables
Sent by: "SPSSX(r) Discussion" <[hidden email]>





At 03:21 PM 11/16/2009, Michael W. Bates wrote:

>I'm a 10 year SAS user who's fairly new to SPSS.  I and importing 5
>excel files with dates in the filename, and would like to be able to
>change the date once in my code and import all 5 files.
>
>define !import1 () 'D:\Reports\Daily\Production File 1 Nov 16 2009.xls' !
>enddefine.
>
>I would like to the 'Nov 16' once and concatenate that with the rest
>of the macro variables, so I don't have to make 5 changes.  SPSS
>doesn't seem to like it when I try to define a separate macro
>variable for the 'Nov 16'.

OK, here's the shock for SAS macro users:
a) You can't create or assign a value to a macro variable except within a macro
b) Macro variables do not persist after the macro they belong to.
They are not available in another macro.


>>> But you can use the !EVAL function to evaluate a macro within a macro.  That might solve the problem here.

The standard SPSS solution is to make the date string an argument to
the macro. I'd love to work that out, and may in a bit, but I'm both
rusty and pressed for time.


>>> But a better solution is to use Python programmability, which is much more powerful and flexible and has none of these problems.


Regards,
Jon Peck

-Best of luck,
 Richard

=====================
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: SPSS Macro Variables

Richard Ristow
First, I wrote,

The standard SPSS solution is to make the date string an argument to
the macro.

No good, of course. Then you'd have to change the argument 5 times, once in each call.

At 04:04 PM 11/17/2009, Jon K Peck wrote:

But you can use the !EVAL function to evaluate a macro within a macro.  That might solve the problem here.

Jon is exactly right, but let me expand.  In SPSS practice, one often uses small macros where, in SAS, you'd use persistent macro variables. That is, outside a macro, you can't

!LET !Date = Nov 16

But you can

DEFINE !Date() Nov 16
!ENDEFINE.

Finally, documentation:

  • SPSS's documentation of macro syntax is in the long article "DEFINE-!ENDDEFINE" in the Command Syntax Reference
  • A good guide is chapter 6, "Macros" in Levesque, Raynald, SPSS® Programming and Data Management, 2nd Edition. SPSS, Inc., Chicago, IL, 2005. (This section is not in later editions. All editions may be freely distributed in PDF form; if you like, I'll send you a copy.)
 
====================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: Can Classification Tree be used on Multiple response variables?

Jarrod Teo-2
In reply to this post by ViAnn Beadle
Hi,

Id   prod    Design     Sound      Storage
1      A         1             0            1
2      A         1             0            0
3      B         1             0            1
4      C         1             1            1
5      C         0             1            1


Each case is a person getting a prod from a company. Example id 1, a person, gets product A and replies that he likes design and storage.

So can classification tree be used in this scenario?

Thanks in advance for the reply.
Dorraj

Date: Tue, 17 Nov 2009 07:55:42 -0700
From: [hidden email]
Subject: Re: Can Classification Tree be used on Multiple response variables?
To: [hidden email]

What’s the definition of a case here. Is it a person or a product?

 

From: DorraJ Oet [mailto:[hidden email]]
Sent: Monday, November 16, 2009 11:36 PM
To: [hidden email]; SPSS Syntax help
Subject: RE: Can Classification Tree be used on Multiple response variables?

 

Hi,

Basically this is a sample of my data and my question is that "What do you really like about our product?"

prod    Design     Sound      Storage
A         1             0            1
A         1             0            0
B         1             0            1
C         1             1            1
C         0             1            1

So as an example, in red, the first participant said something about that they like the design and storage of their product.

1 means say something
0 means say nothing about it

Can I use classification tree then to find out the profile of those people buying product A, B and C?


Date: Mon, 16 Nov 2009 19:25:59 -0700
From: [hidden email]
Subject: Re: Can Classification Tree be used on Multiple response variables?
To: [hidden email]

I think we need more information here. You could include multiple dichotomy variables but each variable will be evaluated separately.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of DorraJ Oet
Sent: Monday, November 16, 2009 6:42 PM
To: [hidden email]
Subject: Can Classification Tree be used on Multiple response variables?

 


Hi,

I will like to know if Classification Tree like CHAID be used on Multiple response variables? This is because I have saw a friend using it in her research.

Thanks.
Dorraj


Windows 7: Find the right PC for you. Learn more.

 


Windows 7: Find the right PC for you. Learn more.



New Windows 7: Find the right PC for you. Learn more.
Reply | Threaded
Open this post in threaded view
|

Re: Can Classification Tree be used on Multiple response variables?

John McConnell-2

Hi Dorraj

 

The simple answer is “yes”, from my perspective.

 

The various Classification Tree algorithms will just treat each separate variable in the set as a separate (nominal level) variable.

 

Unlike some of the Tables options in spss which will group them together.

 

Hope this helps

 

John

 

John McConnell

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of DorraJ Oet
Sent: 18 November 2009 04:19
To: [hidden email]
Subject: Re: Can Classification Tree be used on Multiple response variables?

 

Hi,

Id   prod    Design     Sound      Storage
1      A         1             0            1
2      A         1             0            0
3      B         1             0            1
4      C         1             1            1
5      C         0             1            1

Each case is a person getting a prod from a company. Example id 1, a person, gets product A and replies that he likes design and storage.

So can classification tree be used in this scenario?

Thanks in advance for the reply.
Dorraj


Date: Tue, 17 Nov 2009 07:55:42 -0700
From: [hidden email]
Subject: Re: Can Classification Tree be used on Multiple response variables?
To: [hidden email]

What’s the definition of a case here. Is it a person or a product?

 

From: DorraJ Oet [mailto:[hidden email]]
Sent: Monday, November 16, 2009 11:36 PM
To: [hidden email]; SPSS Syntax help
Subject: RE: Can Classification Tree be used on Multiple response variables?

 

Hi,

Basically this is a sample of my data and my question is that "What do you really like about our product?"

prod    Design     Sound      Storage
A         1             0            1
A         1             0            0
B         1             0            1
C         1             1            1
C         0             1            1

So as an example, in red, the first participant said something about that they like the design and storage of their product.

1 means say something
0 means say nothing about it

Can I use classification tree then to find out the profile of those people buying product A, B and C?


Date: Mon, 16 Nov 2009 19:25:59 -0700
From: [hidden email]
Subject: Re: Can Classification Tree be used on Multiple response variables?
To: [hidden email]

I think we need more information here. You could include multiple dichotomy variables but each variable will be evaluated separately.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of DorraJ Oet
Sent: Monday, November 16, 2009 6:42 PM
To: [hidden email]
Subject: Can Classification Tree be used on Multiple response variables?

 


Hi,

I will like to know if Classification Tree like CHAID be used on Multiple response variables? This is because I have saw a friend using it in her research.

Thanks.
Dorraj


Windows 7: Find the right PC for you. Learn more.

 


Windows 7: Find the right PC for you. Learn more.

 


New Windows 7: Find the right PC for you. Learn more.

Reply | Threaded
Open this post in threaded view
|

Re: Can Classification Tree be used on Multiple response variables?

Anthony Babinec
In reply to this post by Jarrod Teo-2

Classification trees typically analyze a single response variable.

If you have several response variables, you can first perform

a latent class analysis of them. This “reduces” the information

in the response variables to a single variable. The class variable

could be a target variable in a CHAID analysis, say, but there is

a twist. Each respondent has a probability of being in each class,

and you need to take these into account. Statistical Innovations

has a CHAID program that can do this. See the Statistical Innovations

website – there’s an article on this in the CHAID section.

 

Tony Babinec

[hidden email]

 

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.707 / Virus Database: 270.14.71/2510 - Release Date: 11/17/09 13:26:00

Reply | Threaded
Open this post in threaded view
|

Re: Can Classification Tree be used on Multiple response variables?

John Fiedler
SPSS sells both Classification Trees and Answer Tree. What's the difference? I'm still using Answer Tree 2.0 !
 
JOHN
 
----- Original Message -----
Sent: Wednesday, November 18, 2009 7:35 AM
Subject: Re: Can Classification Tree be used on Multiple response variables?

Classification trees typically analyze a single response variable.

If you have several response variables, you can first perform

a latent class analysis of them. This “reduces” the information

in the response variables to a single variable. The class variable

could be a target variable in a CHAID analysis, say, but there is

a twist. Each respondent has a probability of being in each class,

and you need to take these into account. Statistical Innovations

has a CHAID program that can do this. See the Statistical Innovations

website – there’s an article on this in the CHAID section.

 

Tony Babinec

[hidden email]

 

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.707 / Virus Database: 270.14.71/2510 - Release Date: 11/17/09 13:26:00

Reply | Threaded
Open this post in threaded view
|

Re: Can Classification Tree be used on Multiple response variables?

ViAnn Beadle
In reply to this post by Jarrod Teo-2

What are you trying to model. What’s the target variable and target value? If you’re trying to predict which product will be chosen you’ll need to do some that is multinomial.

 

From: DorraJ Oet [mailto:[hidden email]]
Sent: Tuesday, November 17, 2009 9:19 PM
To: [hidden email]; SPSS Syntax help
Subject: RE: Can Classification Tree be used on Multiple response variables?

 

Hi,

Id   prod    Design     Sound      Storage
1      A         1             0            1
2      A         1             0            0
3      B         1             0            1
4      C         1             1            1
5      C         0             1            1

Each case is a person getting a prod from a company. Example id 1, a person, gets product A and replies that he likes design and storage.

So can classification tree be used in this scenario?

Thanks in advance for the reply.
Dorraj


Date: Tue, 17 Nov 2009 07:55:42 -0700
From: [hidden email]
Subject: Re: Can Classification Tree be used on Multiple response variables?
To: [hidden email]

What’s the definition of a case here. Is it a person or a product?

 

From: DorraJ Oet [mailto:[hidden email]]
Sent: Monday, November 16, 2009 11:36 PM
To: [hidden email]; SPSS Syntax help
Subject: RE: Can Classification Tree be used on Multiple response variables?

 

Hi,

Basically this is a sample of my data and my question is that "What do you really like about our product?"

prod    Design     Sound      Storage
A         1             0            1
A         1             0            0
B         1             0            1
C         1             1            1
C         0             1            1

So as an example, in red, the first participant said something about that they like the design and storage of their product.

1 means say something
0 means say nothing about it

Can I use classification tree then to find out the profile of those people buying product A, B and C?


Date: Mon, 16 Nov 2009 19:25:59 -0700
From: [hidden email]
Subject: Re: Can Classification Tree be used on Multiple response variables?
To: [hidden email]

I think we need more information here. You could include multiple dichotomy variables but each variable will be evaluated separately.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of DorraJ Oet
Sent: Monday, November 16, 2009 6:42 PM
To: [hidden email]
Subject: Can Classification Tree be used on Multiple response variables?

 


Hi,

I will like to know if Classification Tree like CHAID be used on Multiple response variables? This is because I have saw a friend using it in her research.

Thanks.
Dorraj


Windows 7: Find the right PC for you. Learn more.

 


Windows 7: Find the right PC for you. Learn more.

 


New Windows 7: Find the right PC for you. Learn more.

Reply | Threaded
Open this post in threaded view
|

Re: Can Classification Tree be used on Multiple response variables?

Jarrod Teo-2
In reply to this post by John McConnell-2
Hi John,
 
Thanks for your reply. I do actually know of a hospital which carried out Text Analysis on their patient complain and through Classification tree, know what is the most serious complain that the patient has. This is done through the first split encounter on the tree.
 
In my case, I want to reuse this method but I am using also SPSS Text Analysis for Survey to categorize my respondents based on what they say to answer my research question.
 
As you know SPSS Text analysis give the exported categories in form of Multiple response answer. I was thinking towards Cluster first then profile. I was also thinking if it is doable if I can explore the usage of Classification tree to profile my respondents instead based on their demo, finanicial and what they say to find out what product they will buy.
 
Thanks for clearing my doubt.
 
Regards
Dorraj

Date: Wed, 18 Nov 2009 00:39:35 -0600
From: [hidden email]
Subject: Re: Can Classification Tree be used on Multiple response variables?
To: [hidden email]

Hi Dorraj

 

The simple answer is “yes”, from my perspective.

 

The various Classification Tree algorithms will just treat each separate variable in the set as a separate (nominal level) variable.

 

Unlike some of the Tables options in spss which will group them together.

 

Hope this helps

 

John

 

John McConnell

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of DorraJ Oet
Sent: 18 November 2009 04:19
To: [hidden email]
Subject: Re: Can Classification Tree be used on Multiple response variables?

 

Hi,

Id   prod    Design     Sound      Storage
1      A         1             0            1
2      A         1             0            0
3      B         1             0            1
4      C         1             1            1
5      C         0             1            1

Each case is a person getting a prod from a company. Example id 1, a person, gets product A and replies that he likes design and storage.

So can classification tree be used in this scenario?

Thanks in advance for the reply.
Dorraj


Date: Tue, 17 Nov 2009 07:55:42 -0700
From: [hidden email]
Subject: Re: Can Classification Tree be used on Multiple response variables?
To: [hidden email]

What’s the definition of a case here. Is it a person or a product?

 

From: DorraJ Oet [mailto:[hidden email]]
Sent: Monday, November 16, 2009 11:36 PM
To: [hidden email]; SPSS Syntax help
Subject: RE: Can Classification Tree be used on Multiple response variables?

 

Hi,

Basically this is a sample of my data and my question is that "What do you really like about our product?"

prod    Design     Sound      Storage
A         1             0            1
A         1             0            0
B         1             0            1
C         1             1            1
C         0             1            1

So as an example, in red, the first participant said something about that they like the design and storage of their product.

1 means say something
0 means say nothing about it

Can I use classification tree then to find out the profile of those people buying product A, B and C?


Date: Mon, 16 Nov 2009 19:25:59 -0700
From: [hidden email]
Subject: Re: Can Classification Tree be used on Multiple response variables?
To: [hidden email]

I think we need more information here. You could include multiple dichotomy variables but each variable will be evaluated separately.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of DorraJ Oet
Sent: Monday, November 16, 2009 6:42 PM
To: [hidden email]
Subject: Can Classification Tree be used on Multiple response variables?

 


Hi,

I will like to know if Classification Tree like CHAID be used on Multiple response variables? This is because I have saw a friend using it in her research.

Thanks.
Dorraj


Windows 7: Find the right PC for you. Learn more.

 


Windows 7: Find the right PC for you. Learn more.

 


New Windows 7: Find the right PC for you. Learn more.



New Windows 7: Simplify what you do everyday. Find the right PC for you.