# HM 1

Due: Tues, 1/28.

1. Successfully install R.

2. When I work on a Windows box, I like to put my data in an "R\\data"

directory. Download "hm1.dat" and place it somewhere. Load it

into R with the scan command. For my setup,

dat=scan("..\\data\\hm1.dat") is the command. Working directory set by: setwd("C:/Users/rouderj/Desktop/ProcMod")

3. dat is a vector. find out how many scores are in it (hint, use

length command). You can type help(length) to learn more about

this command. You can type help.start() for an html help system.

4. Find the sample mean, sample variance, sample standard deviation,

sample median, and sample deciles. Hint: use

mean,var,sd,median,quantile. Dont forget, you can type help(mean)

to learn more about the mean. The help command works for all

commands.

5. Draw a histogram of the data. Hint: hist. Is the data like a normal?

6. Is the mean of the sample significantly different from 90.0? Hint:

use t.test.

OK lets simulate some data:

7. Make x be a vector of 200 samples from a normal with mean of 100

and standard deviation of 15 make y be a vector of 200 samples from a

normal witth mean of 105 and standard deviation of 15. Hint: rnorm

Now, pretend you know nothing about the parameters used to make the data.

8. What is the difference between the sample means?

9. How substantial is it relative to the variability in the data?

Hint: divide difference between sample means by some pooled

estimate of standard deviation.

10. How statistically significant is the difference in sample means.

Use t.test with var.equal=T option. Lets see if we can plot

both samples on the same graph. It will be too messy to do with

histograms. Instead, I like box plots. They arent as detailed as

histograms but they quickly display distributional information.

Try boxplot(x,y). What do the various components denote

(midline, box, wiskers, points)?

Attachment | Size |
---|---|

hm1.dat | 300 bytes |