SOCR ≫ DSPA ≫ Topics ≫

1 Confirm that you have installed R/RStudio

You should be able to download and load in RStudio the Foundations of R code. Then run all the examples.

2 Long-to-Wide Data format translation

You have learned wide-to-long in lecture notes. Now, let’s explore wide-to-long. Load in the long-format SOCR Parkinson’s Disease data and export it as wide format. You can use only 3 variables(exclude case and time variable) you select. Please note that there are several time observations for each subject. You need transform according time variable. Try to use reshape function.

3 Data Frames

Create a Data Frame of the SOCR Parkinson’s Disease data and compute a summary of 3 features you select.

4 Data stratification

Using the same SOCR Parkinson’s Disease data and extract rows satisfying Time=0. Then:

  • 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 and Sex.
  • Compute the mean Age and the correlation between Age and Weight.
  • Plot Histogram and density of R_fusiform_gyrus_Volume and scatterplot L_fusiform_gyrus_Volume and R_fusiform_gyrus_Volume.

Note: You don’t have to apply these data filters sequentially, but this can also be done for deeper stratification.

5 Simulation

Generate 1,000 standard normal variables and 1,200 student t distributed random variables with df=20 and generate a quantile-quantile (Q-Q) probability plot of the 2 samples. Then, compare it with qqnorm of student t simulation.

6 Function

Generate a function that computes the arithmetic average and compare it against the mean function using the simulation data you generate in the last question.

SOCR Resource Visitor number Dinov Email