Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Practice Problem for Midterm Exam 2 - Computing in Statistics | 22S 166, Exams of Statistics

Material Type: Exam; Professor: Cowles; Class: 22S - Computing in Statistics; Subject: Statistics and Actuarial Science; University: University of Iowa; Term: Fall 2007;

Typology: Exams

Pre 2010

Uploaded on 03/10/2009

koofers-user-cre
koofers-user-cre 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Name: ________________________________________
22S:166 Computing in Statistics
Instructor: Cowles
PRACTICE PROBLEMS for Midterm 2, 2007
Instructions: You may use Windows R, or if you prefer, you may log into a Linux
computer and run Linux R. Copy and paste your solutions into this Word document.
Submit your exam by uploading the Word document into ICON.
1. The .75 quantile of a vector of sample values may be used to estimate the
population .75 quantile of the variable of interest.
a. Write an R function to get jackknife estimates of bias and standard error of this
estimator.
Copy your R code here.
b. Generate a vector of 20 random values from a Gamma distribution with
parameters 15 and 0.5. Use this vector as input to your function in part a.
Copy the R output here.
2. Is the jackknife “unbiased” estimate of the 0.75 quantile of a population
distribution really unbiased? Carry out a simulation study to find out for the case
when the sample size is 20 and the population distribution is Gamma(15, 0.5).
Note: when testing and debugging your code, use a very small number of
replicate datasets to save time. Using the jackknife within a simulation study is
time consuming, so you may do your final run with only 1000 replicate datasets.
Copy your R code here.
Copy your R output here.
Write a sentence or two interpreting your results here.
3. Note that the following R code may be used to produce a 90% bootstrap
percentile confidence interval for the .1 quantile of a population distribution based
on a single sample drawn from the population. In the example below, the data is
in a vector called “mydat.”
qfunc <- function(x, index) {quantile(x[index] , 0.1) }
pf3

Partial preview of the text

Download Practice Problem for Midterm Exam 2 - Computing in Statistics | 22S 166 and more Exams Statistics in PDF only on Docsity!

Name: ________________________________________ 22S:166 Computing in Statistics Instructor: Cowles PRACTICE PROBLEMS for Midterm 2, 2007 Instructions: You may use Windows R, or if you prefer, you may log into a Linux computer and run Linux R. Copy and paste your solutions into this Word document. Submit your exam by uploading the Word document into ICON.

  1. The .75 quantile of a vector of sample values may be used to estimate the population .75 quantile of the variable of interest. a. Write an R function to get jackknife estimates of bias and standard error of this estimator. Copy your R code here. b. Generate a vector of 20 random values from a Gamma distribution with parameters 15 and 0.5. Use this vector as input to your function in part a. Copy the R output here.
  2. Is the jackknife “unbiased” estimate of the 0.75 quantile of a population distribution really unbiased? Carry out a simulation study to find out for the case when the sample size is 20 and the population distribution is Gamma(15, 0.5). Note: when testing and debugging your code, use a very small number of replicate datasets to save time. Using the jackknife within a simulation study is time consuming, so you may do your final run with only 1000 replicate datasets. Copy your R code here. Copy your R output here. Write a sentence or two interpreting your results here.
  3. Note that the following R code may be used to produce a 90% bootstrap percentile confidence interval for the .1 quantile of a population distribution based on a single sample drawn from the population. In the example below, the data is in a vector called “mydat.” qfunc <- function(x, index) {quantile(x[index] , 0.1) }

library(boot) boot.out <- boot( mydat, qfunc, R=100) percentile.ci <- boot.ci(boot.out, .90, type="perc")$perc[4:5] Use the above code as part of an R function (or functions) to carry out a simulation study to estimate the coverage of nominal 90% bootstrap percentile confidence intervals when the population distribution is Gamma(2,5) and the sample size is 20. Note that the following line of R code calculates the true theoretical .1 quantile in a Gamma(2,5) population: truth <- qgamma( 0.1, 2,5) Since the bootstrap is computationally intensive, a simulation study of the bootstrap could take a very long time! While you’re coding and testing your R function(s), use no more than 5 replicate datasets and R no larger than 5 in the “boot” function. When you do the final run of simulation study, use 100 replicate datasets and R=100. a. Paste your R code here. b. Paste the output here.

  1. The secretary of the Statistics department has asked you to design an efficient way for her to store information about the faculty in the department and the committees they serve on. Each committee has more than one faculty member on it. Each faculty member can serve on one or more committees. Currently the secretary is storing all the information in one data file. The fields in that data file are as follows:  Name of committee  Name of committee chairperson  Telephone number of chairperson  Email address of chairperson  Committee type (ad hoc or permanent)  Name of committee member 1  Telephone number of committee member 1  Email address of committee member 1  Name of committee member 2  Telephone number of committee member 2  Email address of committee member 2   