SOCR ≫ DSPA ≫ DSPA2 Topics ≫

1 Basics

1.2 R/RStudio Installation

Confirm that you have installed R/RStudio. You should be able to download and load in RStudio as shown in Chapter 1.

2 Problems

Then, complete the following examples.

2.1 Long-to-Wide Data format translation

Load in the long-format SOCR Parkinson’s Disease data and export it as wide format. You can only select any 5 variables (not all), but note that there are several time observations for each subject. You can try using the reshape() method or tidyverse techniques.

2.2 Data Frames

Create a Data Frame storing the SOCR Parkinson’s Disease data and call summary() and Hmsc::describe() to summarize some of the feature characteristics.

2.3 Data stratification

Using the same SOCR Parkinson’s Disease data:

  • Extract the first 10 subjects.
  • Find the cases for which L_caudate_ComputeArea<600.
  • Sort the subjects based on L_caudate_Volume.
  • Generate frequency and probability tables for Gender and Age.
  • 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.

2.4 Simulation

Generate \(1,000\) standard normal variables and \(1,200\) Cauchy distributed random variables and generate a quantile-quantile (Q-Q) probability plot of the pair of samples.

2.5 Programming

Generate an R function that given an object (e.g., vector, matrix, array, tensor), it computes the arithmetic average and compare it against the mean() function.

SOCR Resource Visitor number Web Analytics SOCR Email