|
Julie-Ann wrote;
----------
>From: Julie-Ann Quayle
>Date: 19 November 1996 1:40
>
>
>Dear All
>
>I have a couple of queries regarding the output of the results of a
>questionnaire I'm going to be analysing. Any comments appreciated.
>
>1 I need to give tabulations of the frequencies of responses to
>all categorical questions in the survey which is ok, but I don't seem
>to be able to output more than one table per page - a sample of the sas
>program is given below. Is there an option to enable me to do this ?
>
>DATA SURVEY;
>INFILE 'C:\JAQ\REPORT\DATA.DAT';
>INPUT IDNO SCORE1 SCORE2;
>LABEL IDNO = 'Identification number'
> SCORE1 = 'Question 1'
> SCORE2 = 'Question 2'
>
>FORMAT SCORE1 SCORE2 SCOFMT.;
>RUN;
>
>proc tabulate data=SURVEY ;
> table ALL='Frequency'
> ,(SCORE1 * f=2.0) * n =' ';
> class SCORE1 ;
> table ALL='Frequency'
> ,(SCORE2 * f=2.0) * n =' ';
> class SCORE2;
>run;
>
>2 The results of the survey are to be given back to those who took
>part in the survey, along with the participants own responses for
>comparison, i.e. unique output of the survey results needed for each
>person, to show each frequency table, followed by the individuals response
>for that question * . Any ideas how I can do this? Example of the sort
>of output needed given below.
>
>
> -------------------------------------------
> | | QUESTION 1 |
> | |-------------------------- |
> | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 |
> |---------------+-+--+--+--+--+--+--+---|
> |Frequency | 2 | 2 | 2 | 2 | 7 | 2 | 2 | 1 |
> --------------------------------------------
>
> * Question 1 response : 5
>
>
>Thanks in advance.
>
>Julie-Ann Quayle.
A solution to part one (1) I think can be achieved with the following
code.
My apologies for using a m/frame but the principles remain the same:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%
//userid JOB (A/c #),'N KASPEROVIC',
// CLASS=J,
// MSGCLASS=0,
// NOTIFY=&SYSUID
//**********************************************************************
//S010SAS EXEC SAS
//**********************************************************************
//INDATA DD *
120 50 84
121 55 76
122 87 85
123 56 45
124 34 58
125 87 74
126 76 57
127 56 88
128 76 99
129 65 75
130 65 48
131 55 30
132 89 79
133 99 65
134 66 87
135 56 66
136 34 93
137 67 71
138 89 66
139 55 65
140 55 88
//SYSIN DD *
OPTIONS NODSNFERR
NOCENTER
NOSOURCE
NOMACROGEN
NOSYMBOLGEN
NOSOURCE2;
*--- Read in data in current form and generate SAS dataset with new fields
---;
DATA survey;
KEEP idno question score grade;
LABEL idno = 'Identification number'
FORMAT score 3.;
INFILE indata;
INPUT idno score1 score2;
grade = PUT(score1,2.);
score = score1;
question = 'Question 1';
OUTPUT;
grade = PUT(score2,2.);
score = score2;
question = 'Question 2';
OUTPUT;
PROC TABULATE DATA=survey;
CLASS question grade;
VAR score;
TABLE (ALL='Frequency'*question=' ')
,grade='Score'*(score=' '*F=2.0) * N =' ';
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%
RESULTS IN
----------------------------------------------------------------------------
----//-|
| | Score
|
|-----------------------------------------------//-
|
|30|34|45|48|50|55|56|57|58|65|66|67|71|74|75|76
|-------------------------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-
-+--
|Frequency |Question 1 | .| 2| .| .| 1| 4| 3| .| .| 2| 1| 1| .| .|
.| 2
|
|---------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--//-
| |Question 2 | 1| .| 1| 1| .| .| .| 1| 1| 2| 2| .| 1| 1|
1| 1
----------------------------------------------------------------------------
----//-
I trust this helps with part 1. I'm a bit busy to answer the whole Help
Request but if you don't get a response....
Regards,
Nick KASPEROVIC
NKASPERO@VITGCAB1.TELECOM.COM.AU
Melbourne, AUSTRALIA
|