STT2640-Lab 10

Confidence Interval and One Sample Hypothesis Test for a Population Mean

Part I: Compute a C.I. for the population mean from a sample data.

Problem #1. Psychologists have found that twins, in their early years, tend to have lower IQs and pick up language more slowly than non-twins. The slower intellectual growth of most twins may be caused by benign parental neglect. Suppose it is desired to estimate the mean attention time given to twins per week by their parents. A sample of 50 sets of 2.5-year-old twin boys is taken, and at the end of 1 week, the attention time given to each pair is recorded. The data were recorded in an Excel file named “ATTIMES.csv”. The sample mean is 20.848 with a standard deviation of 13.414.

a)Compute 95% confidence interval for the mean attention time given to all twin boys by their parents and interpret it in the context of the problem.

b)Conduct a hypothesis test to verify the claim that the mean attention time given to all twin boys is not equal two 24. Use alpha=0.05.

Part II: Tutorial Portion:One-sample T test

The following R codes will help you to get summary statistics for the data set. First, download the data set “ATTIMES.csv” onto the desktop, the read data “ATTIMES.csv” into R.

When the population is normally distributed with unknown σ and the sample size n is sample (<30), we must use student-t as our reference distribution for inferences on µ. In this case, R function t.test(data,mu=mu0,alternative=Ha,conf.level=alpha)is used. Here is a simulated example:

> normdata=rnorm(15) # Generate a random sample of size 15 from N(0,1)

> t.test(normdata,mu=0,alternative="greater",conf.level=0.95)

Important:To get two-sided confidence intervals, we need to use “two.sided” in the “alternative” option because the option “greater” and “less” only give us one-sided confidence interval. It is helpful to keep in mind, that the p-value for one-tailed alternative is always half of the p-value of its two-tailed alternative test.

Part III: Lab Portion

Problem #2. Suppose our sample only consists of the first 20 data points in “ATTIMES.csv”. Use by the following commands to create the subdata set named “temp”:

Data=read.csv(file.choose(),header=T)#apostrophe next to the Enter key

> temp=Data[1:20,] # Extract the first 20 data values of second column from data to get attention times

Then, assuming normality, complete the following

a)Compute a 90% confidence interval for the mean attention time.

b)Conduct a hypothesis test to verify the claim that the mean attention time given to all twin boys is not equal to 24. Use alpha=0.1. Organize your answer using five-step method based on R output that we discussed in class.

c)How would you verify the assumption that these 12 data values are from a normal population?

Your lab report includes the following:

1)Solutions to Problem #1 from Part I

2)R script file for Problem #2.

3)R output obtained using your R script for Problem #2 (you may put your R script and output onto one page)

4)Your written answers to Problem #2.