Please complete this assignment using the RMarkdown file provided [Link to Rmarkdown file here]. Once you download the RMarkdown file please (1) include your name in the preamble, (2) rename the file to include your last name (e.g., “weston-homework-1.Rmd”). When you turn in the assignment, include both the .Rmd and knitted .html files.
To receive full credit on this homework assignment, you must earn 15 points. You may notice that the total number of points available to earn on this assignment is 27 – this means you do not have to answer all of the questions. You may choose which questions to answer. You cannot earn more than 15 points, but it may be worth attempting many questions for learning’s sake. Here are a couple things to keep in mind:
Points are all-or-nothing, meaning you cannot receive partial credit if you correctly answer only some of the bullet points for a question. All must be answered correctly.
After the homework has been graded, you may retry questions to earn full credit, but you may only retry the questions you attempted on the first round.
The first time you complete this assignment, it must be turned in by 9am on the due date (January 22). Late assignments will receive 50% of the points earned. For example, if you correctly answer questions totaling 14 points, the assignment will receive 7 points. If you resubmit this assignment with corrected answers (a total of 15 points), the assignment will receive 7.5 points.
You may discuss homework assignments with your classmates; however, it is important that you complete each assignment on your own and do not simply copy someone else’s code. If we believe one student has copied another’s work, both students will receive a 0 on the homework assignment and will not be allowed to resubmit the assignment for points.
Data: Some of the questions in this homework assignment use the dataset referred to as homework-anxiety
. [Link to data goes here.] In this dataset, you’ll find four variables: - id - numeric, refers to participant ID - Anxiety - participant’s average levels of anxiety over a week; Stress – the participant’s average level of stress over a week - Support – the participant’s perceived social support over a week - group – categorical, whether the participant was randomly assigned to a treatment group in which they given mediation instructions and were required to meditate for 10 minutes each day during the week.
Some questions refer to the dataset homework-dawtry.csv
This dataset comes from Study 1a in the article by Dawtry et al. (2015), which examines the relationship between wealth and perception of wealth. Study 1a is an observational study in which American participants indicated their own household income and estimated how incomes are distributed across both their immediate social circles and the wider population. Participants then indicated how fair and satisfactory they perceived society to be and whether they supported redistribution efforts, as well as their political orientation. You may need to refer to the article to complete the questions associated with this dataset.
You are contacted by the Dean’s office. They ran a correlation between UO undergraduate SAT scores and happiness and found a correlation of r = .21061 with a sample of \(N = 600\). They want to know if this is lower than a published meta-analytic estimate (.2554)?
Is the correlation found in the UO sample significantly different from the population parameter? Do this “by hand”. Treat the meta-analytic estimate as the “population.”
Calculate a 95% confidence interval around the estimate correlation “by hand.”
What would the 95% confidence interval around this estimate be if the sample size were only \(N = 60\)?
X | Y |
---|---|
1 | 1 |
5 | 18 |
5 | 13 |
5 | 17 |
3 | 14 |
5 | 20 |
3 | 3 |
4 | 13 |
1 | 1 |
4 | 13 |
4 | 7 |
1 | 7 |
3 | 17 |
4 | 8 |
4 | 3 |
Calculate the unstandardized regression equation (use Y as the outcome). You may use whatever functions you want.
Calculate the standardized regression equation. You may use whatever functions you want.
Refer to the data provided in Question 3.2.
Use the average product of z-scores method to calculate the correlation between x and y. How does this compare to the result of the cor() function?
Why do you think these differ? (Hint: is there a component of the z-score calculation that be computed with two different formulas?)
Change your code in such a way that the product of z-scores does in fact equal the correlation between x and y.
Given a sample size of 40 participants, what is the smallest correlation we are able to detect as being significantly different from 0? Use a two-tailed test and \(\alpha = .05\). (Do not use the pwr
package for this problem – there is an answer that does not depend on power.)
Given a sample size of 40 participants, what is the smallest correlation we are able to detect as being significantly different from .3? Use a two-tailed test and \(\alpha = .05\). (Do not use the pwr
package for this problem – there is an answer that does not depend on power.)
Choices that individuals make in the voting booth, such as whether to support a more conservative or liberal candidate, may be affected by a number of factors. In their research, Beall, Hofer, and Schaller (2016) sought to examine the role of outbreaks of infectious diseases on voting behavior. The authors hypothesized that an outbreak of a disease, such as Ebola, may increase support for more conservative political candidates. To test this hypothesis, the authors examined the frequency of Google searches for “Ebola” during the weeks prior to and after the outbreak of Ebola that occurred in 2014. The authors also examined support for the conservative Republican party in the US.
Below is an image of the output from a regression analysis, using their data: republican
is a measure of support for the republican party; ebola
is an index of the number of searches for Ebola on Google. Each observation was a day leading up to the national election. (Note, if this image does not load, you may need to download it from GitHub and save it in the same location as your homework file.)
There are some missing values in the output, labeled with red letters. Complete the output by computing the missing values (A-L).
Using the data from Dawtry et al. (2015), replicate the correlation matrix part of Table 1. (Note: you will have to create at least one composite to do so, and some of the items may need to be reverse scored.)
Calculate the means and standard deviations for Table 1 variables.
Graph the distributions of Household Income, Fairness and Satisfaction, Social circle mean income, population mean income, and political preference. Comment on anything you find irregular or interesting.
Run a regression where political preferences predict redistribution. Interpret the intercept, the regression coefficient and \(R^2\). Then create a scatter plot with a best fit line between redistribution and political preference variables. Be sure your figure includes a title and a caption.
Dichotomize the political preferences data into a dichotomous conservative and liberal variable, assuming the midpoint is conservative. Then run a linear model with this new binary variable predicting redistribution. What are the conceptual differences between the regression in #5 and #6. Which one would you prefer?