G:\Shared drives\MRDC Documents\Website\mrdcl-learning.com\mrdcl_files\INT-05\getstarted4.stp
start data,
serial number in columns 1-4,
card characters 1000,
!
!This .stp goes back to getstarted2.stp and shows some more practical examples of table production
ds $q1=$5/1,2,e,
v='Yes;
No;
Not stated<z>',
h='Ever used MRDCL\
Yes;
No;
NS<s>',
xt='Q1 Have you used MRDCL before?',
!
!Note that $q1 now has separate vertical and horizontal labels. The heading 'Ever used MRDCL' is followed by a
!backslash (\) to indicate that it is the heading to the following items. It will automatically centre itself
!over the labels. NS has a <s> label control so that it is suppressed when used horizontally. As format UCH is
!set on, the heading will be underlined. See Table 4 for output. You are allowed overheaders which are delimited by
!the character ^ and superheaders which are denoted by *** (3 asterisks).
!
dm $q2=$6-8,e,
x='Ate at a restaurant;
Went to see a film;
Went to watch a sporting event;
None/NS',
xt='Q2 Activities in the past month',
!
f=ifbu,
!
di $iq3a=$9-10,
xt='Q3a Number of children aged 0-8',
!
di $iq3b=$11-12,
xt='Q3b Number of children aged 9-16',
!
di $iq3=$iq3a + $iq3b,
xt='Q3 Number of children aged 0-16',
!
ds $q3=$iq3/0,1,2,3,>3,e,
x='No children;
1 child;
2 children;
3 children;
More than 3 children;
Not stated<z>',
xt='Q3 Number of children in family',
!
ds $q4=$13/1-5,e,
x='Very good (5)<v5>;
Quite good (4)<v4>;
Average (3)<v3>;
Quite poor (2)<v2>;
Very poor (1)<v1>;
Not stated<z>',
xt='Q4 Rating of postal service',
!
!The variable q4 illustrates how you produce mean scores where each bit has a value. The label control <v5> for
!very good tells MRDCL to give that row a score of 5. Not stated as no score on it and will be excluded from
!mean score calculations. Decimal places and negative values may be used, e.g. <v2.3>, <v-3> or <v-3.5> etc.
!
!
dm $mybanner=$q1,$q2/1-3,$q4/1..2,3,4..5,
h=$q1 +
'Activities in past month\
Rest- au- rant;
Saw film;
Spor*ting event;
Postal service\
Good;
Aver- age;
Poor',
!
!The above illustrates some of the techniques you can use to build banners. It uses q1 with the h labels that
!have already been specified for $q1 and then adds to that new labels. MRDCL will do its best to split words
!sensibly in banners. It will look for spaces, commas,dashes or obliques (/). If it cannot find a space, it will break
!it up as best it can where text is too long. You can give it gaps like the way 'restaurant' has been broken up.
!Also you can use * which means throw a new line.
finish data,
start tables,
!
%jh='<jc>My project',
%avg='Average<d2>',
%jf='Prepared by a really good MRDCL specwriter on <&dd> <&month> <&year><jc>',
!This is a global footnote. Note it uses <&dd> to get the day of the month that the run was executed, as well as
!the month and year. Other similar specials allow you to show other date/time options
global bt#='All respondents',
f=dpr1/sdv/spl180/uch/caz'0',
!
select banner $mybanner,
!
!This command means use the variable $mybanner as the banner/header/columns for all tables that do not have a
!banner specified. This means that tables 5, 6 and 7 would use $mybanner rather than show a total only column
!
t#1=$q1 * $q2,
!
t#2=$q3 * $q1,
+t#2x=@ $iq3 * $q1,
!
if $q1/1,t#3=$q3 * $q2,
bt='All who have used MRDCL before',
if $q1/1,+t#3x= @ $q3 * $q2,
!
t#4(f=evr/ser)=$q4 * $q1,
!
!A table with mean scores associated with each bit is just like any other table. This table has a local format setting
!that will set error variances and standard errors for the table. This will be in addition to mean score and standard
!deviations which are set globally. Note the (f=evr/ser) must appear immediately before the = sign.
!
t#5=$q1 *,
!
t#6=$q2 *,
!
t#7=$q4 *,
!
finish tables,
