Homework 1
- Due Sep 17, 2021 by 11:59pm
- Points 100
- Submitting a file upload
Homework Project 1
- Due Fri, Sept 17, 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 SOCR Pediatric Normal and Schizophrenia Neuroimaging Study Dataset Links to an external site.. It's in a wide format where 56 different regional cortical and subcortical volumes contain information we want to represent in long format. Convert the original from wide-to-long and then back to wide format.
Problem 1.2 (Data stratification):
Use the same Schizophrenia Neuroimaging Study Dataset Links to an external site. and complete the following data-manipulation steps in R:
- Extract the first 10 subjects
- Find the cases for which
L_caudate
< 160. - Sort the subjects based on
L_caudate
values in descending and ascending order. - Generate frequency and probability tables for
Age
,FS_IQ
, andSex
. - Compute the mean
Age
and the correlation betweenAge
andFS_IQ
. - Plot Histogram and density of
R_fusiform_gyrus
, and draw scatterplotL_fusiform_gyrus
andL_insular_cortex
.
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()
or plot_ly()
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
|