Stat 301 - HW 8

Due midnight, Friday, March 17

Remember to join a HW group if you are submitting together, to put your names in this file and to include, and to integrate all relevant computer output.

1) Stat 301 students (Coutin & Heffler, 2021) wanted to know whether listening to up-tempo music causes college students to tend to type faster. To collect their data (number of words typed correctly in one minute), the students planned to use the 60-second Easy-Text typing test (TypingTest.com). They recruited 34 Cal Poly students from groups they were associated with on campus (e.g., athletic teams, musical groups).  For the up-tempo music they selected Overture to Candide performed by the London Symphony Orchestra.

Let μnomusic represent the population mean typing speed without the music and μmusic the population mean typing seed with the music.

(a) State the student researchers’ null and alternative hypotheses in symbols and in words.

(b) Briefly describe what a “completely randomized design” (independent samples) would look like. (Be clear how randomization is used.)

(c) Briefly describe/contrast what a matched pairs design would look like. (Be clear how randomization is used.)

(d) According to typingpal.com, an average typing speed is 40 words per minute, and a good targe speed is 65 to 70 words per minute.  Suppose we will be impressed if listening to music increases typing speed by 5 words per minute on average.  Also suppose the variability (standard deviation) of typing speeds is around 14 words per minute.   (Note, this corresponds to an effect size of 5/14 = 0.36.) No question here!

(e) Suppose we plan to use a completely randomized design, randomly assigning 17 students to each treatment.  Find the power we would detect a difference in population mean typing speed in a two-sided test. We had a direction in mind above, but two-sided is the default in both R and JMP, so let’s start there.

 R power.t.test(n=17,delta=5,sd=14,type="two.sample") JMP Choose DOE > Design Diagnostics > Sample Size and Power Choose Two Sample Means Enter 14 as the standard deviation Enter 5 as the difference to detect Enter 34 as the overall sample size (Leave power blank) Press Continue (JMP then fills in the power)

Include your output and give a one-sentence interpretation of the calculated power in the context of this study.

(f) Suppose we plan to use a matched pairs design, asking each student to take the test twice, once with music and once without, randomizing which method they use first.  Should the variability in the speed differences be larger or smaller than the variability in the speeds? Explain your reasoning (should be clear how you are contrasting the two).

(g) Suppose the variability in the speed differences is 10 words per minute.  Calculate the power that we would detect a nonzero mean difference in typing speed in a two-sided test.

 R power.t.test(n=17,delta=5,sd=10,type="paired")   or   power.t.test(n=34,delta=5,sd=10,type="paired") JMP Choose DOE > Design Diagnostics > Sample Size and Power Choose One Sample Mean Enter 10 as the standard deviation Enter 5 as the difference to detect Enter 17 or 34 as the sample size Press Continue

Include your output. How do the power calculations compare?

The data in TypingMusic.txt shows the speeds (in words per minute) for each student using music and not using music.

(h) Create a graph of the differences. Include your output and summarize what you learn. (JMP users, you may want to calculate the differences in Excel?)  Also, calculate the standard deviations of each group (with and without music) as well as the standard deviation of the differences (include output). Is the standard deviation of the differences a lot smaller? (If so, then that says the pairing was helpful.)

(i) Use R or JMP to carry out the one-sample t-test on the differences (aka a matched-pairs t-test).  Note both R and JMP allow you to use the “unstacked” format of these data in BaseRunning.txt.

 R library(readr) typing <- read_delim("http://www.rossmanchance.com/iscam3/data/TypingMusic.txt",     delim = "\t") t.test(typing\$WithMusic, typing\$NoMusic, paired=TRUE) JMP To run a matched pairs analysis using the original two columns of data: Analyze > Specialized Modelling > Matched Pairs Enter both columns in the Y, Paired Responses box and press OK.

Include a screen capture of the results and report the test statistic and two-sided p-value.

(j) Does the t-test appear to be valid for these data? You should comment on the validity conditions of the paired t-test. (Probability plot?)

(k) Regardless of your answer to (j), use R or JMP to calculate and interpret a one-sample t-confidence interval in context (including measurement units).

(l) Carry out a sign test on the paired data:

1.     How many of the difference are positive? How many are negative? How many are zero?

2.     Consider the non-zero differences (i.e., throw-away the ties), what proportion of the non-zero differences are positive?

3.     Use the binomial distribution to determine whether a statistically significant majority of the differences are positive (define the parameter of interest, state the hypotheses, and determine the exact binomial p-value – be sure to include a screen capture of the null distribution showing the p-value).

(m) Does the sign test provide stronger or weaker evidence that one typing method tends to be faster than the other? (Be very clear how you are deciding.)

(n) Would a one-sample z-test be appropriate in (l)?  Explain how you are deciding.

(o) Determine, include output, and interpret in context a 95% confidence interval for .  This time, consider your answer to (n) in deciding which interval procedure to use.

Reminder: Course Evaluations will be due Friday night as well!