table format

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

table format

Sebastián Daza
dear all,
i need make a table with % of a group of dichotomic variables, is very
easy calculate his means (same that %, but divided for 100). somebody
know how change format of mean (ex: 0.563) to 56.3, that is to say,
multiply mean for 100 in "custom tables". thanks all for you help.

Sebastián Daza
UC - Chile
Reply | Threaded
Open this post in threaded view
|

Re: table format

Edward Boadi
Sebastian,
I am not sure if you can do the said transformation within the CTABLE syntax (I stand to be corrected-ViAnn).
One way to accomplish your desired result is to use OMS to save the output of the CTABLE as a .SAV file.
You can then perform any desired operation on the data file.

****Here is an example .

GET FILE = "Type file name here".
OMS /SELECT TABLES
 /IF SUBTYPES=['Custom Table']
 /DESTINATION FORMAT=SAV OUTFILE='c:\Temp\TableMeans.sav'.
* Custom Tables.
CTABLES
  /VLABELS VARIABLES=Var1 Var2 DISPLAY=DEFAULT
  /TABLE Var1 BY Var2 [VALIDN,MEAN]
  /CATEGORIES VARIABLES=Var1 ORDER=A KEY=VALUE EMPTY=EXCLUDE.
OMSEND.
GET FILE='c:\Temp\TableMeans.sav'.

Regards.
Edward.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]]On Behalf Of
Sebastián Daza
Sent: Thursday, September 14, 2006 12:23 PM
To: [hidden email]
Subject: table format


dear all,
i need make a table with % of a group of dichotomic variables, is very
easy calculate his means (same that %, but divided for 100). somebody
know how change format of mean (ex: 0.563) to 56.3, that is to say,
multiply mean for 100 in "custom tables". thanks all for you help.

Sebastián Daza
UC - Chile
Reply | Threaded
Open this post in threaded view
|

Re: table format

Beadle, ViAnn
In reply to this post by Sebastián Daza
If you have a dichotomous variables with values 0 and 1, then the percent of the value 1 is the same as your mean.
You can get this simply by defining a multiple response set using 1 as the counting value and just asking for the percentage:
 
data list list / v1 v2 v3.
begin data
1 0 1
1 0 0
1 0 1
0 1 0
end data.
* Define Multiple Response Sets.
MRSETS
  /MDGROUP NAME=$testset LABEL='three dichtomous variables'
  CATEGORYLABELS=VARLABELS VARIABLES=v1 v2 v3 VALUE=1
  /DISPLAY NAME=[$testset].
* Custom Tables.
CTABLES
  /VLABELS VARIABLES=$testset DISPLAY=DEFAULT
  /TABLE $testset [COLPCT.COUNT 'Mean*100' PCT40.1]
  /CATEGORIES VARIABLES=$testset  EMPTY=INCLUDE.

Note that, as usual, I let the dialog boxes do the heavy work of syntax construction here.
 
Is this what you want?

________________________________

From: SPSSX(r) Discussion on behalf of Sebastián Daza
Sent: Thu 9/14/2006 11:23 AM
To: [hidden email]
Subject: table format



dear all,
i need make a table with % of a group of dichotomic variables, is very
easy calculate his means (same that %, but divided for 100). somebody
know how change format of mean (ex: 0.563) to 56.3, that is to say,
multiply mean for 100 in "custom tables". thanks all for you help.

Sebastián Daza
UC - Chile