Docsity

Computing in Statistics Exam Preparation: SAS and R - Prof. Mary Kathryn Cowles, Exams of Statistics

Toggle sidebar
bg1
22S:166 Computing in Statistics
Fall 2007, Instructor: Cowles
Final exam
Fall 2008: PRACTICE PROBLEMS for FINAL
Name: ___________________________________________________________
4-letter or 4-digit code for posting grade (must not be part of your student id or Social
Security number!): _________
Copy your code, output, and any other required answers for each question into a text
document. Type your name and your code at the top of the document. Submit your
exam by uploading the text file into ICON.
1. Download the data file “blissymbols.dat” from the “Datasets” section of the course
web page. Also, read the description of the dataset in “blisssymbols.info.” Read the
dataset into SAS, and use SAS to create the following table (with column and row
headings as shown). It’s ok if the lines separating the rows and columns in your table
are of a different style from mine.
Include all of your SAS code, and the table it produces, in the answer to this question.
------------------------------------------------
| | score |
| |-----------------------------|
| | N | Mean | StdDev |
|----------------+---+------------+------------|
|Learning style | | | |
|----------------| | | |
|Active | 24| 24.42| 6.31|
|----------------+---+------------+------------|
|Passive | 24| 17.88| 4.03|
------------------------------------------------
pf2

Partial preview of the text

Download Computing in Statistics Exam Preparation: SAS and R - Prof. Mary Kathryn Cowles and more Exams Statistics in PDF only on Docsity!

22S:166 Computing in Statistics Fall 2007, Instructor: Cowles Final exam Fall 2008: PRACTICE PROBLEMS for FINAL Name: ___________________________________________________________ 4-letter or 4-digit code for posting grade (must not be part of your student id or Social Security number!): _________ Copy your code, output, and any other required answers for each question into a text document. Type your name and your code at the top of the document. Submit your exam by uploading the text file into ICON.

  1. Download the data file “blissymbols.dat” from the “Datasets” section of the course web page. Also, read the description of the dataset in “blisssymbols.info.” Read the dataset into SAS, and use SAS to create the following table (with column and row headings as shown). It’s ok if the lines separating the rows and columns in your table are of a different style from mine. Include all of your SAS code, and the table it produces, in the answer to this question. ------------------------------------------------ | | score | | |-----------------------------| | | N | Mean | StdDev | |----------------+---+------------+------------| |Learning style | | | | |----------------| | | | |Active | 24| 24.42| 6.31| |----------------+---+------------+------------| |Passive | 24| 17.88| 4.03| ------------------------------------------------
  1. This problem involves performing a parametric bootstrap procedure using R. The following data vector is believed to be a simple random sample from a poisson distribution: poisdat <- c(5, 2, 3, 2, 5, 7, 5, 8, 3, 3, 6, 5, 8, 5, 5, 3, 3, 8, 3, 1) The following R code uses the glm function to get the maximum likelihood estimate of the natural log of the mean of the population from which the sample was drawn into an R object called mymle.

    glm.out <- glm( poisdat ~ 1, family = poisson()) mymle <- glm.out$coefficients Use R to produce 90% confidence intervals for the log of the population mean, using three different methods: a. asymptotic normal approximation (use the confint.default function) b. a more exact confidence interval (use the confint function) c. a parametric bootstrap percentile interval (use the boot and boot.ci functions). Copy your interactive R code and its output for parts a. and b. For part c., submit all your R functions and the output for a parametric bootstrap run with 1000 datasets. Note: If you are unable to code a parametric bootstrap procedure, you may do a nonparametric bootstrap instead for some partial credit.

  2. Perform a simulation study using R to assess the coverage of the asymptotic 90% confidence intervals produced by the confint.default function when the glm function is used as in problem 2 for samples of size 20 from a Poisson distribution with mean
    1. Submit your R code, and the estimated coverage based on a run with 1000 datasets.