Editing Statistics and Statistical Programming (Spring 2019)/Problem Set: Week 5
From CommunityData
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 5: | Line 5: | ||
: '''PC0.''' The dataset is available as a TSV file in the directory <code>week_05</code> in the [https://communitydata.cc/~ads/teaching/2019/stats/data data repository for the course]. Note that a TSV file is ''tab delimited'', not comma delimited (it is otherwise similar to a CSV file). Go ahead and inspect the data and load it into R (''Hint:'' You'll want to use the <code>read.delim()</code> function). | : '''PC0.''' The dataset is available as a TSV file in the directory <code>week_05</code> in the [https://communitydata.cc/~ads/teaching/2019/stats/data data repository for the course]. Note that a TSV file is ''tab delimited'', not comma delimited (it is otherwise similar to a CSV file). Go ahead and inspect the data and load it into R (''Hint:'' You'll want to use the <code>read.delim()</code> function). | ||
: '''PC1.''' Calculate the mean of the variable <code>x</code> in the full dataset. Go back to your Week 3 problem set and revisit the mean you calculated for <code>x</code>. Be prepared to discuss the ''conceptual'' relationship of these two means to each other. | : '''PC1.''' Calculate the mean of the variable <code>x</code> in the full dataset. Go back to your Week 3 problem set and revisit the mean you calculated for <code>x</code>. Be prepared to discuss the ''conceptual'' relationship of these two means to each other. | ||
: '''PC2.''' Again, using the variable <code>x</code> from your Week 3 data, compute the 95% confidence interval for the mean of this vector "by hand" (in R) using the normal formula for standard error <math>(\frac{\sigma}{\sqrt{n}})</math>. (''Bonus:'' Do this by writing a function.) | : '''PC2.''' Again, using the variable <code>x</code> from your Week 3 data, compute the 95% confidence interval for the mean of this vector in two ways "by hand" (in R) using the normal formula for standard error <math>(\frac{\sigma}{\sqrt{n}})</math>. (''Bonus:'' Do this by writing a function.) | ||
<!--- | <!--- | ||
:* (b) Using an appropriate built-in R function (see this week's R lecture materials for a relevant example). | :* (b) Using an appropriate built-in R function (see this week's R lecture materials for a relevant example). |