Docsity

Statistical Programming - Homework 2 | STA 402, Assignments of Statistics

Toggle sidebar
bg1
Homework 2
C:\baileraj\Classes\Fall 2005\sta402\hw\Homework-02-28aug05.doc
Assigned: 31 Sept. 2005
Due: 9 Sept. 2005
1. Read the data from the “country.data” set into SAS. Note
that the order of the variables in the data set is:
country name
area
population size
percent population living in an urban setting
primary language
literacy
life expectancy men
life expectancy women
per capita gross national product (GNP)
Use sensible variable names. In addition, use relevant titles
for the output.
2. Construct log10-transformed variables for
area
population size
per capita GNP
Retain only the log10-transformed versions of these variables
in later analyses (i.e. drop these three untransformed variables
from your data set).
3. Construct an indicator variable that takes on value=1 if the
primary language is “English” and value=0 if the primary language
differs from “English.”
4. Set up informative labels for all of the variables you input
or construct.
5. Define a new variable which will contain a formatted version
of the life expectancy variables with values 1=[min, Q1]; 2=(Q1,
M]; 3=(M, Q3]; 4=(Q3, max]. Call these new variables
“life_men_quartile” and “life_women_quartile.”
6. Repeat step 5 with the literacy variable. Call this new
variable “literacy_quartile.”
1
pf2

Partial preview of the text

Download Statistical Programming - Homework 2 | STA 402 and more Assignments Statistics in PDF only on Docsity!

Homework 2

C:\baileraj\Classes\Fall 2005\sta402\hw\Homework-02-28aug05.doc

Assigned: 31 Sept. 2005 Due: 9 Sept. 2005

  1. Read the data from the “country.data” set into SAS. Note that the order of the variables in the data set is:

country name area population size percent population living in an urban setting primary language literacy life expectancy men life expectancy women per capita gross national product (GNP)

Use sensible variable names. In addition, use relevant titles for the output.

  1. Construct log10-transformed variables for area population size per capita GNP

Retain only the log10-transformed versions of these variables in later analyses (i.e. drop these three untransformed variables from your data set).

  1. Construct an indicator variable that takes on value=1 if the primary language is “English” and value=0 if the primary language differs from “English.”
  2. Set up informative labels for all of the variables you input or construct.
  3. Define a new variable which will contain a formatted version of the life expectancy variables with values 1=[min, Q1]; 2=(Q1, M]; 3=(M, Q3]; 4=(Q3, max]. Call these new variables “life_men_quartile” and “life_women_quartile.”
  4. Repeat step 5 with the literacy variable. Call this new variable “literacy_quartile.”
  1. Generate a description of your data set using PROC CONTENTS. Include in your solution a listing of the variables, their assigned labels, etc. from this procedure.
  2. Generate a print out of your data set sorted by country name within “literacy_quartile.”
  3. Generate a table with the five number summary for all of the numeric variables. Recall that the “5 number summary” includes (min, Q1, M, Q3, max).
  4. Generate a set of plots in which life expectancy for women is plotted on the Y-axis and each of the numeric variables are presented in turn on the X-axis. Try to place this collection of plots on one printed page.
  5. Generate a scatterplot matrix using the Interactive Data Analysis functions in SAS. To do this, select

Solutions > Analysis > Interactive Data Analysis

  • open data set WORK > COUNTRY
    • select columns (CTRL and click column labels)
    • Analyze > Scatter Plot (YX)

As an aside, you can also generate a regression fit via this interactive data analysis using Analyze > Fit

  • This is not necessary for this assignment.
  1. Generate a cross-classification table with life_men_quartile labeling columns and “literacy_quartile” labeling the rows. Report the results of a statistical test of the independence of these two factors.