## The electric cooperative needs to know the mean household usage of electricity by its non-commercial customers in kWh per day

The electric cooperative needs to know the mean household usage of electricity by its non-commercial customers in kWh per day. They would like the estimate to have a maximum error of 0.13 kWh. A previous study found that for an average family the standard deviation is 2.1 kWh and the mean is 15.8 kWh per day. If they are using a 99% level of confidence, how large of a sample is required to estimate the mean usage of electricity? Round your answer up to the next integer.

## Doing factorial ANOVA Coursera quiz answers

Qn1. Download the file avatars.csv from the course materials. This file describes a study in which men and women were shown a virtual human avatar that was itself either male of female, and asked to craft a persona and write a day-in-th0life scenario for that avatar. The number of positive sentiments in either description were summed by a blind panel of judges. Examine the data and indicate what kind of experiment design this was.

• A 2 x 2 between-subjects design with factors for sex (M,F) and Avatar (M,F)
• A 2 x2 within-subjects design with factors for ex (M,F) and Avatar (M,F).
• A 2 x 2 mixed factorial design with a between-subjects factor for sex (M,F) and a within-subjects factor for Avatar (M,F).
• None of the above

Qn2. How many subjects took part in this experiment?

Qn3. To the nearest hundredth (two digits), on average how many positive sentiments were expressed for the most positive combination of sex and avatar?
Qn4. Create an interaction plot with Sex on the X-axis and Avatar as the traces. Do the lines cross?

``````Yes
No
``````

Qn5. Create an interaction plot with Avatar on the X-axis and Sex as the traces. Do the line cross?

``````Yes,
No
``````

Qn6. Conduct a factorial ANOVA on positives by sex avatar. To the nearest hundredth (two digits), what is the largest F statistic from such a test? Hint: Use the ez library and its exANOVA function. Pass both Sex and Avatar as the between parameter using a vector created with the “c” function.

Qn7. Which effects are statistically significant in the factorial ANOVA of positives by sex and avatar? (Mark all that apply)

``````Main effect of sex
Main effect of Avatar
Sex * Avatar interaction
None of the above
``````

## Planned Pairwise Comparisons

Qn8. Conduct two planned pairwise comparisons using independent samples t-tests. The first question is whether women produced different numbers of positive sentiments for male avatars versus female avatars. The second question is whether men produced different numbers of positive sentiments for male avatars versus female avatars. Assuming equal variances and using Holm’s sequential Bonferroni procedure to correct for multiple comparisons, what to within a ten-thousandth (four digits) is the lowest corrected p-value from these tests? Hint: You will need conjunctions with ampersands (&) to select the necessary rows for your t.test functions.

Qn9. Which of the following conclusions are supported by the planned pairwise comparisons just conducted? (Mark all that apply.)

``````Women made significantly more positive sentiments about male avatars that they did female avatars
Women made significantly more positive sentiments about female avatars than they did male avatars
Men made significantly more positive sentiments about male avatars than they did female avatars
Men made significantly more positive sentiments about female avatars than they did male avatars
None of the above
``````

Qn10. Download the file notes.csv from the course materials. This file describes a study in which iphone and Android smartphone owners used their phone’s built-in note-taking app and then switched to an add-on third-party app, or vice-versa. The number of words they wrote in their notes apps over the course of the week was recorded. Examine the data and indicate what kind of experiment design this was

``````A 2 x 2 between-subjects design with factors for phone (iPhone, Android) and Notes (Built-in, Add-on).
A 2 x 2 **within-subjects design with factors** for Phone(iPhone, Android) and Notes (Built-in, Add-on)
A 2 x2 mixed factorial design with a between-subjects factor for Phone (iPhone, Andoid) and a within-subjects factor for Notes (Built-in, Add-on).
None of the above``````

Qn11. How many subjects took part in this experiment?

Qn12. To the nearest hundredth (two digits) on average how many words were record with the most heavily used combination of phone and notes?

Qn13. Create an interaction plot with Phone on the X-axis and Notes as the traces, Do the lines cross?

``````Yes
No``````

Qn14. Create an interaction plot with notes on the X-axis and Phones as the traces. Do the lines cross?

``````Yes
No
``````

Qn15. Conduct a factorial ANOVA to test for any order effect that the presentation order of the Notes factor may have had. To the nearest ten-thousandth (four digits), what is the p-value for the order factor from such a test? Hint: use the ez library and its ezANOVA function, passing one between parameter and Order as the withing parameter.

Qn16. In our test of possible order effects, Mauchly’s test of sphericity is irrelevant because our within-subjects factor only has two levels, which cannot present a sphericity violation.

``````True
False
``````

Qn17. Conduct a factorial ANOVA on words by phone and Notes. To the nearest hundredth (two digits), what is the largest F statistic produced by such a test? Hint: use the ez library and its ezANOVA function, passing one between parameter and on within parameter.

Qn18. Conduct two planned pairwise comparisons using paired-samples t-tests. The first question is whether iPhone users entered different numbers of words using built-in notes apps versus the add-on notes app. The second question is whether Android users entered different numbers of words using the built-in notes app versus the add-on notes app. Assuming equal variances and using Holm’s sequential Bonferroni procedure to correct for multiple comparisons, what to within a ten-thousandth (four digits) is the lowest p-value from these tests? Hint: use the reshape2 library and its dcast function to make a wide-format table with columns for subject, phone, Add-on, and Built-in, and then within each phone type, do a paired-samples t-test between the Add-on and built-in columns.

Qn19. Which of the following conclusions are supported by the planned pairwise comparisons just conducted? (Mark all that apply)

``````Android users entered significantly more words using the built-in notes app than theadd-on notes app.
Android users entered significantly more words using the add-on notes app than the built-in notes app.
iPhone users entered significantly more words using the add-on notes app than the built-in notes app.
None of the above

``````

## Doing Oneway ANOVAS

Qn1. Download the file alphabets.csv from the course materials. This file describes a study in which people used a pen-based stroke alphabets to enter a set of textphases. How many different stroke alphabets are being compared?
Qn2. To the nearest hundredth (two digits), what was the average text entry speed in words per minute (WPM) of the EdgeWrite alphabet?

Qn3. Conduct Shapiro-Wilk normality tests on the WPM response for each Alphabet. Which of the following, if any, violate the normality test? (Mark all that apply.)

``````-Unistrokes
-Graffiti
-EdgeWrite
-None of the above``````

Qn4. Conduct a Shapiro-Wilk normality test on the residuals of a WPM by Alphabet model. To the nearest ten-thousandth (four digits), what is the p-value from such a test? Hint: Fit a model with aov and then run Shapiro.test on the model residuals.

Qn5. Conduct a Brown-Forsythe homoscedasticity test on WPM by Alphabet. To the nearest then-thousandth (four digits), what is the p-value from such a test? Hint: Use the car library and its level Test function with center=median

Qn6. Conduct a oneway ANOVA on WPM by Alphabet. To the neares hundredth (two digits), what is the F statistic from such a test?
Qn7. Perform simultaneous pairwise comparisons among levels of Alphabet sing the Tukey approach. Adjust for multiple comparisons using Holm’s sequential Bonferroni procedure. To the nearest ten-thousandth (four digits), what is the corrected p-value for the comparison of Unistrokes to graffiti? Hint: use the multcomp library and its mcp function called form within its glht function.
Qn8. According to the results of the simultaneous pairwise comparisons, which of the following levels of Alphabet are significantly different in terms of WPM? Mark all that apply.)

``````-Unistrokes vs. graffiti
- Unistrokes vs, EdgeWrite
- Graffiti vs. EdgeWrite
- None of the above``````

Qn9. Conduct a Kruskal-Wallis test on WPM by Alphabet. To the nearest ten-thousandth (four digits), what is the p-value from such a test? Hint: use the coin library and its Kruskal-test function with distribution = “asymptotic”

Qn10. Conduct nonparametric post hoc pairwise comparisons of WPM among all levels of Alphabet manually using separate Mann-Whitnet U tests. Adjust the p-values using Holm’s sequential Bonferroni procedure, To the nearest ten-thousandth (four digits), what is the corrected p-value for Unistrokes vs. graffiti? Hint: The coin library’s Wilcoc_test only takes a model formular specification. For this, you need wilcox.test with paired = FALSE ((and to avoid warnings= FALSE))

## Understanding Oneway Designs

Qn1. The issue that requires an experimenter to use a oneway ANOVA instead of a t-test is when there are more than two response categories available.

``````-True
-False
``````

Qn2. Which of the following is the equivalent nonparametric analysis to a parametric oneway ANOVA?

``````-F-test
-t-test
-Kruskal-Wallis test
-Mann-Whitney U test
None of the above
``````

Qn3. Typically, an ANOVA uses which distribution and test statistic?

``````-F
-t
-Chi-square
-Kolmogorov-Smirnov
-Poisson
``````

Qn4. If an omnibus oneway ANOVA for a three-level factor is statistically significant, it does not mean that post hoc pairwise comparisons are allowed.

``````-True
-False
``````

Qn5. Which of the following is the most proper way to report an F-test result?

``````-F(14) = 9.07, p = 0.009
-F(14) = 9.06, p < 0.01
-F(1,14)=  9.09, p = 0.009
-F(1,14) = 9.06, p < .01``````

-None of the above

Qn6. A oneway ANOVA is characterized by which experimental design?

``````-An Experiment with a single between-subject factor of exactly two levels.
-An experiment with a single between-subjects factor of two to more levels.
-An experiment with a single within-subjects factor of exactly two levels.
-An experiment with a single within-subjects factor of two or more levels.
-None of the above

``````