max-min

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

max-min

Rodrigo Briceño
Dear SPSS users. Today I'm doing a calculation over 600 observations. I'm using the normalization formula, which requires to use (Xi-Xmin)/(Xmax-Xmin). The issue in my mind is that Max and Min are functions that apply over variables (comparing x1 with x2 for example) not over observations (what is the max or min value for the 600 individuals).

I though about using add function, but I wanted to ask if there is any other way to do this procedure.

Thanks in advance
--
__________________________________________________________________

__________________________________________________________________

Rodrigo Briceño
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113   Oficina Costa Rica
+506  22-32-08-30                  Fax
[hidden email]
www.sanigest.com

MSN:
[hidden email]
SKYPE: rbriceno1087

_____________________

This communication contains legal information which is privileged and confidential. It is for the exclusive use of the address and distribution, dissemination, copying or use by others is strictly prohibited. If you have received this communication by error, please delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial para el uso exclusivo del destinatario. La distribución, diseminación, copia u otro uso por terceras personas es estrictamente prohibida. Si usted ha recibido esta comunicación por error, le rogamos borrar el mensaje original y comunicárnoslo a esta misma dirección.

Reply | Threaded
Open this post in threaded view
|

Re: max-min

Mike
__________________________________________________________________
I believe that you can use the aggregate procedure to calculate the
the min and max across cases and have these values added to your
active dataset as new variables.  If you are using SPSS ver 17 or
above you don't need to specify a break variable.  Here is some
example code:
 
AGGREGATE
 /OUTFILE=*  MODE=ADDVARIABLES
 /X01_min=min(X1)
 /X02_max=max(X1)
 /X02_min=min(X2)
 /etc.
I will leave it to others with more familiarity with this procedure to point
out if there are any problems with the syntax or if it can be simplified
further.
-Mike Palij
New York University
 
----- Original Message -----
Sent: Wednesday, January 27, 2010 12:57 PM
Subject: max-min

Dear SPSS users. Today I'm doing a calculation over 600 observations. I'm using the normalization formula, which requires to use (Xi-Xmin)/(Xmax-Xmin). The issue in my mind is that Max and Min are functions that apply over variables (comparing x1 with x2 for example) not over observations (what is the max or min value for the 600 individuals).

I though about using add function, but I wanted to ask if there is any other way to do this procedure.

Thanks in advance
--

__________________________________________________________________

Rodrigo Briceño
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113   Oficina Costa Rica
+506  22-32-08-30                  Fax
[hidden email]
www.sanigest.com

MSN:
[hidden email]
SKYPE: rbriceno1087

_____________________

This communication contains legal information which is privileged and confidential. It is for the exclusive use of the address and distribution, dissemination, copying or use by others is strictly prohibited. If you have received this communication by error, please delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial para el uso exclusivo del destinatario. La distribución, diseminación, copia u otro uso por terceras personas es estrictamente prohibida. Si usted ha recibido esta comunicación por error, le rogamos borrar el mensaje original y comunicárnoslo a esta misma dirección.

Reply | Threaded
Open this post in threaded view
|

Re: max-min

Marta Garcia-Granero
In reply to this post by Rodrigo Briceño
Rodrigo Briceño wrote:
> Dear SPSS users. Today I'm doing a calculation over 600 observations.
> I'm using the normalization formula, which requires to use
> (Xi-Xmin)/(Xmax-Xmin). The issue in my mind is that Max and Min are
> functions that apply over variables (comparing x1 with x2 for example)
> not over observations (what is the max or min value for the 600
> individuals).
>
> I though about using add function, but I wanted to ask if there is any
> other way to do this procedure.

I suppose you mean AGGREGATE with ADD VARIABLES... Why don't you want to
use it?

OK, here is a somewhat complicated, using MATRIX, solution that can be
easily turnt into a MACRO, and modified in order to make it add the
normalized variable to the dataset, without having to add to the dataset
variables with min&max values.

* Sample dataset (replace by your own) *.
DATA LIST LIST/id(F8) Xi(F8).
BEGIN DATA
 1 10
 2 15
 3 2
 4 47
 5 21
 6 19
 7 17
 8 18
 9 14
10 3
END DATA.
DATASET NAME OriginalData.

DATASET DECLARE Normalized WINDOW=MINIMIZED.
MATRIX.
GET Data /VAR=id Xi /NAMES=VNames /MISSING=OMIT.
COMPUTE MyVar=Data(:,2).
COMPUTE MinX=CMIN(MyVar).
COMPUTE MaxX=CMAX(MyVar).
COMPUTE NormData=(MyVar-MinX)/(MaxX-MinX).
COMPUTE Export={Data,NormData}.
COMPUTE VNames={VNames,"NormX"} .
SAVE Export /OUTFILE=Normalized /NAMES=VNames.
END MATRIX.
DATASET ACTIVATE Normalized.
APPLY DICTIONARY
  /FROM OriginalData
  /SOURCE VARIABLES = ALL
  /FILEINFO
  /VARINFO ALIGNMENT FORMATS LEVEL MISSING VALLABELS = REPLACE ATTRIBUTES =
  REPLACE VARLABEL WIDTH .
LIST.

HTH,
MGG

(PS: yes, I know I'm back again using a very expensive pen able to work
in zero gravity, while using a pencil is cheaper...)


--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/

=====================
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: max-min

Bruce Weaver
Administrator
In reply to this post by Mike
Mike Palij wrote
__________________________________________________________________
I believe that you can use the aggregate procedure to calculate the
the min and max across cases and have these values added to your
active dataset as new variables.  If you are using SPSS ver 17 or
above you don't need to specify a break variable.  Here is some
example code:

AGGREGATE
 /OUTFILE=*  MODE=ADDVARIABLES
 /X01_min=min(X1)
 /X02_max=max(X1)
 /X02_min=min(X2)
 /etc.

I will leave it to others with more familiarity with this procedure to point
out if there are any problems with the syntax or if it can be simplified
further.

-Mike Palij
New York University
mp26@nyu.edu
Mike & Marta, look again at what the OP said:

"The issue in my mind is that Max and Min are functions that apply over variables (comparing x1 with x2 for example) not over observations (what is the max or min value for the 600 individuals)."

I took "observations" to mean cases (or rows).  So AGGREGATE is giving the wrong min & max.  The file would have to be flipped first, I think.

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

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
Reply | Threaded
Open this post in threaded view
|

Re: max-min

Richard Ristow
In reply to this post by Rodrigo Briceño
At 12:57 PM 1/27/2010, Rodrigo Briceño wrote:

I'm doing a calculation using the normalization formula, which requires to use (Xi-Xmin)/(Xmax-Xmin). The issue in my mind is that Max and Min are functions that apply over variables (comparing x1 with x2 for example) not over observations (what is the max or min value for the 600 individuals).

Is it as simple as this? SPSS has functions for taking the max and min over sets of variables, within records:

COMPUTE Xmax=MAX(X1 to Xnnn).
COMPUTE Xmin=MIN(X1 to Xnnn).

Or, am I missing your point? I think other responders to your post understood you differently.
====================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: max-min

Mike
In reply to this post by Bruce Weaver
----- Original Message -----
On Wednesday, January 27, 2010 6:13 PM, Bruce Weaver wrote:
Subject: Re: max-min
> Mike & Marta, look again at what the OP said:
>
> "The issue in my mind is that Max and Min are functions that apply over
> variables (comparing x1 with x2 for example) not over observations (what is
> the max or min value for the 600 individuals)."
>
> I took "observations" to mean cases (or rows).  So AGGREGATE is giving the
> wrong min & max.  The file would have to be flipped first, I think.

I admit that the original message was a little unclear but the
problem is trivial if one wants to calculate the minimum and
maximum values for a set of variables instead of cases.
Consider:

Compute X1_min=min(var1,var2,...varK).
Compute X1_max=max(var1,var2,...varK).

It does seem that the documentation for SPSS has gotten worse
over the years.  In the PDF manuals I have for versions 15 and 16
there are no examples with the max function (ver 15 base manual
p268; ver 16 base manual p296 -- the base manual for ver 18
only provide menu options in the core systems guide, perhaps syntax
is elsewhere). I presume that one can use the awkward help menus
instead.  I had to go back to "Big White Manual" (version 4) to get
a simple listing of all of the functions for the Compute command
(see pp85-91). I assume that all serious SPSS users have a copy
of "Big White". ;-)

-Mike Palij
New York University
[hidden email]


---Original Message:

> Mike Palij wrote:
>>
>> __________________________________________________________________
>> I believe that you can use the aggregate procedure to calculate the
>> the min and max across cases and have these values added to your
>> active dataset as new variables.  If you are using SPSS ver 17 or
>> above you don't need to specify a break variable.  Here is some
>> example code:
>>
>> AGGREGATE
>>  /OUTFILE=*  MODE=ADDVARIABLES
>>  /X01_min=min(X1)
>>  /X02_max=max(X1)
>>  /X02_min=min(X2)
>>  /etc.
>>
>> I will leave it to others with more familiarity with this procedure to
>> point
>> out if there are any problems with the syntax or if it can be simplified
>> further.
>>
>> -Mike Palij
>> New York University
>> [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
|

Vista-PAWS18 Question

Salbod
Dear Friends, I installed PASW18 on a Vista machine. At this point I didn't see an icon problem. However, when I saved an .sps file (syntax) I found that PASW18 does not associate the 'syntaxfile icon' with the saved file. In fact, no associations are made and I am unable to launch PASW18 by clicking the .sps file. Is there a way to straighten out the associations?

Any help will be greatly appreciated.

Happy Trails, Steve



-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mike Palij
Sent: Wednesday, January 27, 2010 7:07 PM
To: [hidden email]
Subject: Re: max-min

----- Original Message -----
On Wednesday, January 27, 2010 6:13 PM, Bruce Weaver wrote:
Subject: Re: max-min
> Mike & Marta, look again at what the OP said:
>
> "The issue in my mind is that Max and Min are functions that apply over
> variables (comparing x1 with x2 for example) not over observations (what is
> the max or min value for the 600 individuals)."
>
> I took "observations" to mean cases (or rows).  So AGGREGATE is giving the
> wrong min & max.  The file would have to be flipped first, I think.

I admit that the original message was a little unclear but the
problem is trivial if one wants to calculate the minimum and
maximum values for a set of variables instead of cases.
Consider:

Compute X1_min=min(var1,var2,...varK).
Compute X1_max=max(var1,var2,...varK).

It does seem that the documentation for SPSS has gotten worse
over the years.  In the PDF manuals I have for versions 15 and 16
there are no examples with the max function (ver 15 base manual
p268; ver 16 base manual p296 -- the base manual for ver 18
only provide menu options in the core systems guide, perhaps syntax
is elsewhere). I presume that one can use the awkward help menus
instead.  I had to go back to "Big White Manual" (version 4) to get
a simple listing of all of the functions for the Compute command
(see pp85-91). I assume that all serious SPSS users have a copy
of "Big White". ;-)

-Mike Palij
New York University
[hidden email]


---Original Message:

> Mike Palij wrote:
>>
>> __________________________________________________________________
>> I believe that you can use the aggregate procedure to calculate the
>> the min and max across cases and have these values added to your
>> active dataset as new variables.  If you are using SPSS ver 17 or
>> above you don't need to specify a break variable.  Here is some
>> example code:
>>
>> AGGREGATE
>>  /OUTFILE=*  MODE=ADDVARIABLES
>>  /X01_min=min(X1)
>>  /X02_max=max(X1)
>>  /X02_min=min(X2)
>>  /etc.
>>
>> I will leave it to others with more familiarity with this procedure to
>> point
>> out if there are any problems with the syntax or if it can be simplified
>> further.
>>
>> -Mike Palij
>> New York University
>> [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

=====================
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: max-min

Rodrigo Briceño
In reply to this post by Mike
Thanks to all that answered my message. Aggregate function was the best solution (simple).
Sorry if I wrote something confusing, but the issue was to calculate the maximum or minimum value over a set of observations (cases). See what I did with the variable tdes:

AGGREGATE
  /OUTFILE=* MODE=ADDVARIABLES
  /BREAK=
  /tdes_min=MIN(tdes).
AGGREGATE
  /OUTFILE=* MODE=ADDVARIABLES
  /BREAK=
  /tdes_max=MAX(tdes).
compute tdes_norm = ((tdes_max-tdes)/(tdes_max-tdes_min))*100.
execute.
delete variables tdes_min tdes_max.

__________________________________________________________________

__________________________________________________________________

Rodrigo Briceño
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113   Oficina Costa Rica
+506  22-32-08-30                  Fax
[hidden email]
www.sanigest.com

MSN:
[hidden email]
SKYPE: rbriceno1087

_____________________

This communication contains legal information which is privileged and confidential. It is for the exclusive use of the address and distribution, dissemination, copying or use by others is strictly prohibited. If you have received this communication by error, please delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial para el uso exclusivo del destinatario. La distribución, diseminación, copia u otro uso por terceras personas es estrictamente prohibida. Si usted ha recibido esta comunicación por error, le rogamos borrar el mensaje original y comunicárnoslo a esta misma dirección.



Mike Palij escribió:
----- Original Message -----
On Wednesday, January 27, 2010 6:13 PM, Bruce Weaver wrote:
Subject: Re: max-min
  
Mike & Marta, look again at what the OP said:

"The issue in my mind is that Max and Min are functions that apply over
variables (comparing x1 with x2 for example) not over observations (what is
the max or min value for the 600 individuals)."

I took "observations" to mean cases (or rows).  So AGGREGATE is giving the
wrong min & max.  The file would have to be flipped first, I think.
    

I admit that the original message was a little unclear but the
problem is trivial if one wants to calculate the minimum and
maximum values for a set of variables instead of cases.
Consider:

Compute X1_min=min(var1,var2,...varK).
Compute X1_max=max(var1,var2,...varK).

It does seem that the documentation for SPSS has gotten worse
over the years.  In the PDF manuals I have for versions 15 and 16
there are no examples with the max function (ver 15 base manual
p268; ver 16 base manual p296 -- the base manual for ver 18
only provide menu options in the core systems guide, perhaps syntax
is elsewhere). I presume that one can use the awkward help menus
instead.  I had to go back to "Big White Manual" (version 4) to get
a simple listing of all of the functions for the Compute command
(see pp85-91). I assume that all serious SPSS users have a copy
of "Big White". ;-)

-Mike Palij
New York University
[hidden email]


---Original Message:
  
Mike Palij wrote:
    
__________________________________________________________________
I believe that you can use the aggregate procedure to calculate the
the min and max across cases and have these values added to your
active dataset as new variables.  If you are using SPSS ver 17 or
above you don't need to specify a break variable.  Here is some
example code:

AGGREGATE
 /OUTFILE=*  MODE=ADDVARIABLES
 /X01_min=min(X1)
 /X02_max=max(X1)
 /X02_min=min(X2)
 /etc.

I will leave it to others with more familiarity with this procedure to
point
out if there are any problems with the syntax or if it can be simplified
further.

-Mike Palij
New York University
[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: max-min

Jon K Peck
In reply to this post by Mike

1.  The command Command Syntax Reference is accessible from the Help menu under that name.  It has comprehensive descriptions of all of the transformation functions.
2.  The regular help contains the same information under Universals>Transformation Expressions in the Contents panel with the functions all organized in logical groups
3.  The Compute dialog automatically shows the short help for any function selected in the functions list.

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



From: Mike Palij <[hidden email]>
To: [hidden email]
Date: 01/27/2010 05:09 PM
Subject: Re: [SPSSX-L] max-min
Sent by: "SPSSX(r) Discussion" <[hidden email]>





----- Original Message -----
On Wednesday, January 27, 2010 6:13 PM, Bruce Weaver wrote:
Subject: Re: max-min
> Mike & Marta, look again at what the OP said:
>
> "The issue in my mind is that Max and Min are functions that apply over
> variables (comparing x1 with x2 for example) not over observations (what is
> the max or min value for the 600 individuals)."
>
> I took "observations" to mean cases (or rows).  So AGGREGATE is giving the
> wrong min & max.  The file would have to be flipped first, I think.

I admit that the original message was a little unclear but the
problem is trivial if one wants to calculate the minimum and
maximum values for a set of variables instead of cases.
Consider:

Compute X1_min=min(var1,var2,...varK).
Compute X1_max=max(var1,var2,...varK).

It does seem that the documentation for SPSS has gotten worse
over the years.  In the PDF manuals I have for versions 15 and 16
there are no examples with the max function (ver 15 base manual
p268; ver 16 base manual p296 -- the base manual for ver 18
only provide menu options in the core systems guide, perhaps syntax
is elsewhere). I presume that one can use the awkward help menus
instead.  I had to go back to "Big White Manual" (version 4) to get
a simple listing of all of the functions for the Compute command
(see pp85-91). I assume that all serious SPSS users have a copy
of "Big White". ;-)

-Mike Palij
New York University
[hidden email]


---Original Message:
> Mike Palij wrote:
>>
>> __________________________________________________________________
>> I believe that you can use the aggregate procedure to calculate the
>> the min and max across cases and have these values added to your
>> active dataset as new variables.  If you are using SPSS ver 17 or
>> above you don't need to specify a break variable.  Here is some
>> example code:
>>
>> AGGREGATE
>>  /OUTFILE=*  MODE=ADDVARIABLES
>>  /X01_min=min(X1)
>>  /X02_max=max(X1)
>>  /X02_min=min(X2)
>>  /etc.
>>
>> I will leave it to others with more familiarity with this procedure to
>> point
>> out if there are any problems with the syntax or if it can be simplified
>> further.
>>
>> -Mike Palij
>> New York University
>> [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: max-min

Mike
Jon, I assume that the Help menu provides some of the info that I
referred to but:
 
(1)  You have to have SPSS operating at the time to check the help menu.
Perhaps some people have SPSS on all of the time but I only have it open
when I'm doing analyses.  When I'm checking email I usually am not using
SPSS.  Indeed, I might even be checking email from a machine without
SPSS on it.  However, I might have PDF copies of the manuals (I have
them on a USB drive) or actual book (i.e., the "Big White Manual") which,
to an experienced user, is actually easier to use in locating info.  Well, at
least in the older manuals.
 
(2)  Outside of getting the syntax components for a command or
procedure, say by highlighting the initial words of the command/procedure
and then clicking on "/_ " icon which provide all of the subcommands
and keywords, I have never found the Help menus very useful, in part,
because the hypertext structure requires one to leave one page of text to
get to another.  One has to know which link to click on in order to find
the information that one is looking for, otherwise one has to look through
several of the links to find the info.  Case in point, earlier today I provide
an example using the aggregate procedure and I had to search through
several links before finding info on the MODE= subcommand (a relatively
recent addition to aggregate).  All I wanted to do was verify that I
had specified it correctly but it took far too long to find and even then
the examples were unclear.
 
Perhaps I lack appropriate knowledge about the current functioning
of SPSS to be able to appreciate the wisdom of what you're saying.
Then again, maybe the assumptions you make are different from the
assumptions made by a mere end user.  
 
-Mike Palij
New York University
 
 
----- Original Message -----
Sent: Wednesday, January 27, 2010 7:51 PM
Subject: Re: [SPSSX-L] max-min


1.  The command Command Syntax Reference is accessible from the Help menu under that name.  It has comprehensive descriptions of all of the transformation functions.
2.  The regular help contains the same information under Universals>Transformation Expressions in the Contents panel with the functions all organized in logical groups
3.  The Compute dialog automatically shows the short help for any function selected in the functions list.

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



From: Mike Palij <[hidden email]>
To: [hidden email]
Date: 01/27/2010 05:09 PM
Subject: Re: [SPSSX-L] max-min
Sent by: "SPSSX(r) Discussion" <[hidden email]>





----- Original Message -----
On Wednesday, January 27, 2010 6:13 PM, Bruce Weaver wrote:
Subject: Re: max-min
> Mike & Marta, look again at what the OP said:
>
> "The issue in my mind is that Max and Min are functions that apply over
> variables (comparing x1 with x2 for example) not over observations (what is
> the max or min value for the 600 individuals)."
>
> I took "observations" to mean cases (or rows).  So AGGREGATE is giving the
> wrong min & max.  The file would have to be flipped first, I think.

I admit that the original message was a little unclear but the
problem is trivial if one wants to calculate the minimum and
maximum values for a set of variables instead of cases.
Consider:

Compute X1_min=min(var1,var2,...varK).
Compute X1_max=max(var1,var2,...varK).

It does seem that the documentation for SPSS has gotten worse
over the years.  In the PDF manuals I have for versions 15 and 16
there are no examples with the max function (ver 15 base manual
p268; ver 16 base manual p296 -- the base manual for ver 18
only provide menu options in the core systems guide, perhaps syntax
is elsewhere). I presume that one can use the awkward help menus
instead.  I had to go back to "Big White Manual" (version 4) to get
a simple listing of all of the functions for the Compute command
(see pp85-91). I assume that all serious SPSS users have a copy
of "Big White". ;-)

-Mike Palij
New York University
[hidden email]


---Original Message:

> Mike Palij wrote:
>>
>> __________________________________________________________________
>> I believe that you can use the aggregate procedure to calculate the
>> the min and max across cases and have these values added to your
>> active dataset as new variables.  If you are using SPSS ver 17 or
>> above you don't need to specify a break variable.  Here is some
>> example code:
>>
>> AGGREGATE
>>  /OUTFILE=*  MODE=ADDVARIABLES
>>  /X01_min=min(X1)
>>  /X02_max=max(X1)
>>  /X02_min=min(X2)
>>  /etc.
>>
>> I will leave it to others with more familiarity with this procedure to
>> point
>> out if there are any problems with the syntax or if it can be simplified
>> further.
>>
>> -Mike Palij
>> New York University
>> [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
|

Help on Custom Table

Jarrod Teo-2
In reply to this post by Jon K Peck
Hi All,

Is it possible to do the following for a custom table?


 

Highest degree

4 Graduate

Count

Column N %

Confidence in major companies

1 A great deal

46

37.4%

2 Only some

66

53.7%

3 Hardly any

11

8.9%

Total

123

100.0%

Confidence in education

1 A great deal

36

29.0%

2 Only some

78

62.9%

3 Hardly any

10

8.1%




Table A


 

Highest degree

4 Graduate

Count

Column N %

Confidence in major companies

1 A great deal

46

100.0%

Total

46

100.0%

Confidence in education

1 A great deal

36

100.0%




Table B

Now I will like to hide the categories Only Some and Hardly Any from Table A but still retain the Column N % value from Table A in my Table B.

The problem is that whenever I took out the Only Some and Hardly Any categories, SPSS recalculate the total and the column N % value change accordingly to 100% as shown in Table B.

It will be nice if someone can provide the syntax way and the Click Drag and Drop way. Thanks.

Regards
Dorraj Oet



Hotmail: Trusted email with powerful SPAM protection. Sign up now.
Reply | Threaded
Open this post in threaded view
|

Re: max-min

Jon K Peck
In reply to this post by Mike

The Command Syntax Reference is a standard, albeit large, PDF file and can be accessed inside SPSS from the Help menu or stand-alone via the usual Acrobat Reader.

If you just want a quick summary of command syntax, press F1 in the syntax window or click the help toolbar button with the cursor on the command to see a syntax chart and links to detailed help.  That would have confirmed the spelling in the AGGREGATE example.  For AGGREGATE F1 takes you directly to a page that lists all the keywords and functions for that procedure.  And the CSR link has the equivalent list if you are looking at the PDF.

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



From: "Mike Palij" <[hidden email]>
To: <[hidden email]>, Jon K Peck/Chicago/IBM@IBMUS
Cc: "Mike Palij" <[hidden email]>
Date: 01/27/2010 06:44 PM
Subject: Re: [SPSSX-L] max-min





Jon, I assume that the Help menu provides some of the info that I
referred to but:
 
(1)  You have to have SPSS operating at the time to check the help menu.
Perhaps some people have SPSS on all of the time but I only have it open
when I'm doing analyses.  When I'm checking email I usually am not using
SPSS.  Indeed, I might even be checking email from a machine without
SPSS on it.  However, I might have PDF copies of the manuals (I have
them on a USB drive) or actual book (i.e., the "Big White Manual") which,
to an experienced user, is actually easier to use in locating info.  Well, at
least in the older manuals.
 
(2)  Outside of getting the syntax components for a command or
procedure, say by highlighting the initial words of the command/procedure
and then clicking on "/_ " icon which provide all of the subcommands
and keywords, I have never found the Help menus very useful, in part,
because the hypertext structure requires one to leave one page of text to
get to another.  One has to know which link to click on in order to find
the information that one is looking for, otherwise one has to look through
several of the links to find the info.  Case in point, earlier today I provide
an example using the aggregate procedure and I had to search through
several links before finding info on the MODE= subcommand (a relatively
recent addition to aggregate).  All I wanted to do was verify that I
had specified it correctly but it took far too long to find and even then
the examples were unclear.
 
Perhaps I lack appropriate knowledge about the current functioning
of SPSS to be able to appreciate the wisdom of what you're saying.
Then again, maybe the assumptions you make are different from the
assumptions made by a mere end user.  
 
-Mike Palij
New York University
mp26@...
 
 
----- Original Message -----
From: Jon K Peck
To: Mike Palij ; [hidden email]
Sent: Wednesday, January 27, 2010 7:51 PM
Subject: Re: [SPSSX-L] max-min


1.  The command Command Syntax Reference is accessible from the Help menu under that name.  It has comprehensive descriptions of all of the transformation functions.

2.  The regular help contains the same information under Universals>Transformation Expressions in the Contents panel with the functions all organized in logical groups

3.  The Compute dialog automatically shows the short help for any function selected in the functions list.


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


From: Mike Palij <[hidden email]>
To: [hidden email]
Date: 01/27/2010 05:09 PM
Subject: Re: [SPSSX-L] max-min
Sent by: "SPSSX(r) Discussion" <[hidden email]>






----- Original Message -----
On Wednesday, January 27, 2010 6:13 PM, Bruce Weaver wrote:
Subject: Re: max-min
> Mike & Marta, look again at what the OP said:
>
> "The issue in my mind is that Max and Min are functions that apply over
> variables (comparing x1 with x2 for example) not over observations (what is
> the max or min value for the 600 individuals)."
>
> I took "observations" to mean cases (or rows).  So AGGREGATE is giving the
> wrong min & max.  The file would have to be flipped first, I think.

I admit that the original message was a little unclear but the
problem is trivial if one wants to calculate the minimum and
maximum values for a set of variables instead of cases.
Consider:

Compute X1_min=min(var1,var2,...varK).
Compute X1_max=max(var1,var2,...varK).

It does seem that the documentation for SPSS has gotten worse
over the years.  In the PDF manuals I have for versions 15 and 16
there are no examples with the max function (ver 15 base manual
p268; ver 16 base manual p296 -- the base manual for ver 18
only provide menu options in the core systems guide, perhaps syntax
is elsewhere). I presume that one can use the awkward help menus
instead.  I had to go back to "Big White Manual" (version 4) to get
a simple listing of all of the functions for the Compute command
(see pp85-91). I assume that all serious SPSS users have a copy
of "Big White". ;-)

-Mike Palij
New York University
[hidden email]


---Original Message:
> Mike Palij wrote:
>>
>> __________________________________________________________________
>> I believe that you can use the aggregate procedure to calculate the
>> the min and max across cases and have these values added to your
>> active dataset as new variables.  If you are using SPSS ver 17 or
>> above you don't need to specify a break variable.  Here is some
>> example code:
>>
>> AGGREGATE
>>  /OUTFILE=*  MODE=ADDVARIABLES
>>  /X01_min=min(X1)
>>  /X02_max=max(X1)
>>  /X02_min=min(X2)
>>  /etc.
>>
>> I will leave it to others with more familiarity with this procedure to
>> point
>> out if there are any problems with the syntax or if it can be simplified
>> further.
>>
>> -Mike Palij
>> New York University
>> [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: Help on Custom Table

Dennis Deck
In reply to this post by Jarrod Teo-2

Any attempt to restrict the response options will result in new percentages.

One option, of course, is to cut and paste the selected results you want.

 

However, you could create new variables based on the old such as:

COMPUTE Confidence1 = (Confidence=1) .

But you’ll still get two values in the results—  for choice 1 and not 1 (everything else)

 

A better way would be to compute a new variable expressed as a percentage:

COMPUTE ConfidencePct = (Confidence=1) * 100 .

The result will be either 0 or 100 for each case.

The MEAN of this variable is the percent reporting Confidence = 1

You can use MEANS or SUMMARY to produce a table of the means across multiple items.

 

Of course, you would have to add FORMATS, VARIABLE LABELS, VALUE LABELS, etc for the new variables.

 

Dennis Deck

RMC Research


From: DorraJ Oet [mailto:[hidden email]]
Sent: Wednesday, January 27, 2010 5:57 PM
Subject: Help on Custom Table

 

Hi All,

Is it possible to do the following for a custom table?

<u3:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_image001.wmz" u4:title=""/>

 

Highest degree

4 Graduate

Count

Column N %

Confidence in major companies

1 A great deal

46

37.4%

2 Only some

66

53.7%

3 Hardly any

11

8.9%

Total

123

100.0%

Confidence in education

1 A great deal

36

29.0%

2 Only some

78

62.9%

3 Hardly any

10

8.1%

 

 

 

Table A



 

Highest degree

4 Graduate

Count

Column N %

Confidence in major companies

1 A great deal

46

100.0%

Total

46

100.0%

Confidence in education

1 A great deal

36

100.0%

 

 

 

Table B

Now I will like to hide the categories Only Some and Hardly Any from Table A but still retain the Column N % value from Table A in my Table B.

The problem is that whenever I took out the Only Some and Hardly Any categories, SPSS recalculate the total and the column N % value change accordingly to 100% as shown in Table B.

It will be nice if someone can provide the syntax way and the Click Drag and Drop way. Thanks.

Regards
Dorraj Oet


Hotmail: Trusted email with powerful SPAM protection. Sign up now.

Reply | Threaded
Open this post in threaded view
|

Re: Help on Custom Table

Jon K Peck
In reply to this post by Jarrod Teo-2

The SPSSINC MODIFY TABLES extension command can hide selected portions of a table.  Here is an example using the cars.sav datafile shipped with Statistics.  The MODIFY TABLES command hides the rows labelled 3 Cylinders and 5 Cylinders based on the innermost row labels.

CTABLES  /TABLE cylinder BY horse [MEAN].

SPSSINC MODIFY TABLES subtype="'Custom Table'"
SELECT="3 Cylinders" "5 Cylinders"
DIMENSION= ROWS HIDE=TRUE.

This extension command can be downloaded from SPSS Developer Central (www.spss.com/devcentral).  It requires at least version 17 and the Python programmability plugin.  The download includes a dialog box interface.

HTH,

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



From: DorraJ Oet <[hidden email]>
To: [hidden email]
Date: 01/27/2010 06:59 PM
Subject: [SPSSX-L] Help on Custom Table
Sent by: "SPSSX(r) Discussion" <[hidden email]>





Hi All,

Is it possible to do the following for a custom table?

 
Highest degree
4 Graduate
Count
Column N %
Confidence in major companies 1 A great deal
46
37.4%
2 Only some
66
53.7%
3 Hardly any
11
8.9%
Total
123
100.0%
Confidence in education 1 A great deal
36
29.0%
2 Only some
78
62.9%
3 Hardly any
10
8.1%

Table A

 
Highest degree
4 Graduate
Count
Column N %
Confidence in major companies 1 A great deal
46
100.0%
Total
46
100.0%
Confidence in education 1 A great deal
36
100.0%

Table B

Now I will like to hide the categories Only Some and Hardly Any from Table A but still retain the Column N % value from Table A in my Table B.

The problem is that whenever I took out the Only Some and Hardly Any categories, SPSS recalculate the total and the column N % value change accordingly to 100% as shown in Table B.

It will be nice if someone can provide the syntax way and the Click Drag and Drop way. Thanks.

Regards
Dorraj Oet



Hotmail: Trusted email with powerful SPAM protection. Sign up now.