Computer Examples--Correlation, Regression, and ANCOVA


1. Correlation and Simple Regression

Previously, all students in the class had an opportunity to demonstrate their "preferred" and "non-preferred" grip strength using a handgrip dynamometer. The purpose of this experiment was to both find the relationship between the strength scores for the two hands and to also determine a regression equation for predicting "non-preferred" strength when the "preferred" is known. What is the Pearson product-moment correlation between the two variables and what is the appropriate
regression equation?

Computer Program -- BMDP6D -- Data File = GRIP
  /PROBLEM TITLE IS 'SIMPLE REGRESSION WITH SCATTERPLOT'.
  /INPUT       VARIABLES ARE 2.
               FORMAT IS '(T3,2F2.0)'.
               FILE = 'grip'..
  /VARIABLE    NAMES ARE PREFER,NPREF.
  /PLOT        XVAR IS PREFER.
               YVAR IS NPREF.
  /END
  /FINISH
Computer Program -- BMDP2R -- Data File = Grip
  /PROBLEM TITLE IS 'SIMPLE REGRESSION WITH SIG. TEST'.
  /INPUT       VARIABLES ARE 2.
               FORMAT IS '(T3,2F2.0)'.
               FILE = 'grip'.
  /VARIABLE    NAMES ARE PREFER,NONPREF.
  /REGRESS     DEPENDENT IS NONPREF.
  /END
  /FINISH
2. Multiple Regression

Faculty who teach beginning statistics at the University of Nebraska are interested in being able to determine those students who are apt to be anxious about working with computers, and also find other variables which may be related to computer anxiety. Such information would be useful to anticipate potential problems and also to devise strategies which might reduce computer anxieties. In the spring of 1986, students enrolled in three sections of introductory statistics were asked to complete a battery of paper and pencil tests and also answer items on a survey dealing with computer anxiety. The following data were collected: age, gender, math anxiety, pretest state anxiety, posttest state anxiety, trait anxiety, computer experience, and computer anxiety. Determine which independent variables are significantly related to the dependent variable (computer anxiety).

Computer Program -- SPSS
  DATA LIST FILE='mreg' / AGE 8-9 SEX 11 MATHANX 23-25
               PRESTATE 27-28 POSTATE 30-31 COMPANX 33-34
               TRAIT 43-44 COMPEXP 46
  TITLE 'EXAMPLES OF STEPWISE MULTIPLE CORRELATION'
  MISSING VALUES ALL (0)
  SUBTITLE 'TRUE STEPWISE SELECTION'
  REGRESSION DESCRIPTIVES/
               STATISTICS = DEFAULTS HISTORY CHA ZPP/
               VARIABLES = AGE TO COMPEXP/
               DEPENDENT = COMPANX/
               STEPWISE
  SUBTITLE 'BACKWARD SELECTION'
  REGRESSION DESCRIPTIVES/
               STATISTICS = DEFAULTS HISTORY CHA ZPP/
               VARIABLES = AGE TO COMPEXP/
               DEPENDENT = COMPANX/
               BACKWARD
  SUBTITLE 'FORWARD SELECTION'
  REGRESSION DESCRIPTIVES/
               STATISTICS = DEFAULTS HISTORY CHA ZPP/
               VARIABLES = AGE TO COMPEXP/
               DEPENDENT = COMPANX/
               FORWARD
  FINISH
3. One-factor Analysis of Covariance

In order to make a decision concerning future equipment needs, an elementary-school principal designed the following experiment to evaluate three different methods of teaching spelling. Eighteen first-grade children were given a vocabulary test (the control measure) to determine their verbal ability before the program was begun. The three different teaching methods were used for three months, and then a standard spelling test was given. Determine if there is a difference among the teaching methods and also if there is a significant relationship between the covariate and the dependent variable for the subjects.

Computer Program -- BMDP2V -- Data File = DCOVAR
  /PROBLEM TITLE IS 'ONE-FACTOR ANCOVA'.
  /INPUT       VARIABLES ARE 3.
               FORMAT IS '(T3,F1.0,2F3.0)'.
               FILE = 'dcovar'.
  /VARIABLE    NAMES ARE CATEGORY,VTEST,SPELL.
  /DESIGN      DEPENDENT IS SPELL.
               GROUPING IS CATEGORY.
               COVARIATE IS VTEST.
  /GROUP       CODES(1) ARE 1 TO 3.
               NAMES(1) ARE METH1,METH2,METH3.
  /END
  /FINISH
Computer Program -- BMDP1V -- Data File = DCOVAR
  /PROBLEM TITLE IS 'ONE-FACTOR ANCOVA-BMDP1V'. 
  /INPUT       VARIABLES ARE 3.
               FORMAT IS '(T3,F1.0,2F3.0)'.
               FILE = 'dcovar'.
  /VARIABLE    NAMES ARE CATEGORY,VTEST,SPELL.
               GROUP = CATEGORY.
  /GROUP       CODES(1) = 1 TO 3.
               NAMES(1) ARE METH1,METH2,METH3.
  /DESIGN      TITLE = 'ONEWAY ANOVA'.
               DEPEND = SPELL.
               INDEP = VTEST.
  /END
  /FINISH
Computer Program -- BMDP1V -- Data File = DCOVAR
  /PROBLEM TITLE IS 'ONEWAY FOR ANCOVA-TUKEY'.
  /INPUT       VARIABLES ARE 2.
               FORMAT IS '(T3,F1.0,F3.0)'.
               FILE = 'dcovar'.
  /VARIABLE    NAMES ARE CATEGORY,VTEST.
               GROUPING IS CATEGORY.
  /GROUP       CODES(1) ARE 1 TO 3.
               NAMES(1) ARE M1,M2,M3.
  /SUBPROBLEM  TITLE IS 'ONEWAY ANOVA OF COVARIATE'.
               DEPENDENT IS VTEST.
  /END
  /FINISH

4. Two-factor Analysis of Covariance

A certain university was engaged in teaching Peace Corps volunteers the foreign languages they would need during their tour of duty. The following experiment was carried out to determine the effectiveness of the different teaching methods that were used. All students were first given a language aptitude test, which provided the control measure (covariate). Data from this aptitude test revealed that there was a great deal of variability among the scores. Since all of the students were not able to participate in the experiment at the same time, they were placed in experimental groups
on the basis of when they participated rather than on the basis of their aptitude scores. The average aptitude scores of the resulting experimental groups differed considerably. It is for this reason that a covariance analysis was needed. Using statistical procedures, the covariance analysis equated the groups on aptitude scores so that any differences found after the experiment could be interpreted as results of the experimental manipulations rather than of the original differences in aptitudes.

The experiment that was carried out was to evaluate two methods of teaching the foreign languages and to determine the value of language laboratory sessions. The two teaching methods were (l) formal classroom meetings with lectures and (2) no formal classroom meetings--only conversation held in a congenial atmosphere. In addition, half of the students being taught by each teaching method spent three hours a day in the language laboratory using the tape recording equipment. The other half of the students in each group never entered the language lab.

Two years later, when the volunteers returned from overseas, they were asked to evaluate the degree to which their language training prepared them for their work. The ratings were on a ten-point scale. These ratings served as the dependent variable in the study. Determine the results of this two-factor ANCOVA and also find if the covariate was significantly related to the dependent variable.

Computer Program -- BMDP2V -- Data File -- DCOVAR2
  /PROBLEM TITLE IS 'TWO-FACTOR ANCOVA'.
  /INPUT       VARIABLES ARE 4.
               FORMAT IS '(T3,2F1.0,2F3.0)'.
               FILE = 'dcovar'.
  /VARIABLE    NAMES ARE METHOD,LABCOND,LATEST,ATT.
  /DESIGN      DEPENDENT IS ATT.
               GROUPING ARE METHOD,LABCOND.
               COVARIATE IS LATEST.
  /GROUP       CODES(1) ARE 1,2.
               NAMES(1) ARE 'CLASS','CONVER'.
               CODES(2) ARE 1,2.
               NAMES(2) ARE 'LAB', 'NOLAB'.
  /END
  /FINISH
Return to Advanced Statistics Index Page