/* Computer Anxiety in Middle School Chlidren */ /* The following procedure specifies value lables for variables. */ PROC FORMAT; VALUE \$sex 'M'='Male' 'F'='Female'; VALUE exp 1='upto 1 year' 2='2-3 yrs' 3='3+ yrs'; VALUE school 1='rural' 2='city' 3='suburban'; DATA anxiety; INFILE 'CLAS.DAT'; INPUT ID 1-2 SEX \$ 3 (EXP SCHOOL) (1.) (C1-C10) (1.) (M1-M10) (1.) MATHSCOR 26-27 COMPSCOR 28-29; FORMAT SEX \$SEX.; FORMAT EXP EXP.; FORMAT SCHOOL SCHOOL.; /* Conditional transformation */ IF MATHSCOR=99 THEN MATHSCOR=.; IF COMPSCOR=99 THEN COMPSCOR=.; /* Recoding variables. Several items are to be reversed while scoring. */ /* The Likert type questionnaire had a choice range of 1-5. */ C3=6-C3; C5=6-C5; C6=6-C6; C10=6-C10; M3=6-M3; M7=6-M7; M8=6-M8; M9=6-M9; COMPOPI = SUM (OF C1-C10) /*Finding sum of 10 items using sum function. */; MATHATTI = M1+M2+M3+M4+M5+M6+M7+M8+M9+M10 /*Adding item by item. */; /* Labeling variables. */ LABEL ID='STUDENT IDENTIFICATION' SEX='STUDENT GENDER' EXP='YRS OF COMP EXPERIENCE' SCHOOL='SCHOOL REPRESENTING' MATHSCOR='SCORE IN MATHEMATICS' COMPSCOR='SCORE IN COMPUTER SCIENCE' COMPOPI='TOTAL FOR COMP SURVEY' MATHATTI='TOTAL FOR MATH ATTI SCALE'; /* Printing data set. */ PROC PRINT; VAR EXP SCHOOL MATHSCOR COMPSCOR COMPOPI MATHATTI; TITLE 'LISTING OF THE VARIABLES'; /* Generating frequency tables. */ PROC FREQ DATA=ANXIETY; TABLES SEX EXP SCHOOL; TABLES (EXP SCHOOL)*SEX; TITLE 'FREQUENCY COUNT'; /* Getting means of variables. */ PROC MEANS DATA=ANXIETY; VAR COMPOPI MATHATTI MATHSCOR COMPSCOR; TITLE 'DESCRIPTIVE STATICTS FOR CONTINUOUS VARIABLES'; /* Correlation analysis of variables */ PROC CORR DATA=ANXIETY; VAR COMPOPI MATHATTI MATHSCOR COMPSCOR; TITLE 'CORRELATION ANALYSIS OF VARIABLES'; /* The following step creates a data subset with males alone */ DATA MALES; SET ANXIETY; IF SEX EQ 'M'; /* Sorting the data based on school to use the the variable SCHOOL */ /* on the BY statment under PROC MEANS. */ PROC SORT DATA=MALES; BY SCHOOL; PROC MEANS DATA=MALES; BY SCHOOL; VAR COMPOPI MATHATTI MATHSCOR COMPSCOR; RUN;