HW1
- Due Sep 18, 2020 by 11:59pm
- Points 100
- Submitting a file upload
Homework Project 1
- Due Fri, Sept 18, 2020
- Homeworks, projects and assignments
- Homework Submission Rules
- Homework Headers
Problem 1.1 (Long-to-Wide Data format translation):
We demonstrated the wide-to-long conversion in lecture. Now, let’s explore long-to-wide. Load in the long-format SOCR Parkinson's Disease data and export it as wide format. For simplicity, just choose only 3 variables (avoiding case
and time variables). Please note that there are several time observations for each subject. You need to transform the features according to the time variable. Try to use reshape
function.
Problem 1.2 (Data stratification):
Use the same SOCR Parkinson's Disease data and extract rows satisfying Time=0
. Complete the following protocol in R:
- Extract the first 10 subjects
- Find the cases for which
L_caudate_ComputeArea
<600. - Sort the subjects based on
L_caudate_Volume
in descending and ascending order. - Generate frequency and probability tables for
Age
andSex
. - Compute the mean
Age
and the correlation betweenAge
andWeight
. - Plot Histogram and density of
R_fusiform_gyrus_Volume
and scatterplotL_fusiform_gyrus_Volume
andR_fusiform_gyrus_Volume
.
Generate 1,000 standard normal variables and another 1,200 student t
distributed random variables with df=20
. Generate a quantile-quantile (Q-Q) probability plot of the two samples. Then, compare it with qqnorm
of student t
simulation and interpret the findings.
Define a new function myMedian()
that computes a sample median and compare your function against the standard R median()
function using the simulation data you generate in the last question (1.3). Did you cover all possible situations for the input data?
Rubric
Criteria | Ratings | Pts | ||
---|---|---|---|---|
Correctness and scientific validity
threshold:
pts
|
|
pts
--
|
||
Result reproducibility
threshold:
pts
|
|
pts
--
|
||
Content focus, presentaiton style, and clarity
threshold:
pts
|
|
pts
--
|
||
Total Points:
100
out of 100
|