Editing Statistics and Statistical Programming (Spring 2019)/Problem Set: Week 2

From CommunityData

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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 13: Line 13:
:'''PC5.''' Create some visualizations of your dataset: at the very least, create a boxplot and histogram.
:'''PC5.''' Create some visualizations of your dataset: at the very least, create a boxplot and histogram.
:'''PC6.''' Some of you will have negative numbers. Whoops! Recode all negative numbers as missing (i.e. NA) in your dataset. Now compute a new mean and standard deviation. How does it change? ('''Hint:''' the <code>mean()</code> function may now produce an error. You have to include the argument <code>na.rm=TRUE</code> to work around this.)  
:'''PC6.''' Some of you will have negative numbers. Whoops! Recode all negative numbers as missing (i.e. NA) in your dataset. Now compute a new mean and standard deviation. How does it change? ('''Hint:''' the <code>mean()</code> function may now produce an error. You have to include the argument <code>na.rm=TRUE</code> to work around this.)  
:'''PC7.''' Log transform your dataset (i.e., take the natural logarithm for each value). If you have very small values it may be helpful to add 1 to each value before you take the natural logarithm (this avoids nonsense values). Calculate the new mean, median, and standard deviation of the transformed variable. Also create a new histogram and boxplot.
:'''PC7.''' Log transform your dataset (i.e., take the natural logarithm for each value). Create new histograms and boxplots, as well as new mean, median, and standard deviation.  
:'''PC8.''' Briefly discuss any important differences you observe between the original variable and the new variable (i.e., the one you removed negative values from and log-transformed).
:'''PC8.''' Briefly discuss any important differences you observe between the original data and the log-transformed data.
:'''PC9.''' Save your work and archive the project (i.e., in a .zip file) and [https://canvas.northwestern.edu/courses/90927/assignments/577505 upload it to canvas].
:'''PC9.''' Save your work and archive the project (i.e., in a .zip file) and [https://canvas.northwestern.edu/courses/90927/assignments/577505 upload it to canvas].


Please note that all contributions to CommunityData are considered to be released under the Attribution-Share Alike 3.0 Unported (see CommunityData:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)