This extended practical session aims the implementation of some basic DataSHIELD functions and the interpretation of the results, this is possible to do independently having completed the DataSHIELD user tutorial. 

Login into the DASIM data tables

# If they haven't been loaded yet, load all the DataSHIELD libraries.
library(opal)
library(dsBaseClient)
library(dsStatsClient)
library(dsGraphicsClient)
library(dsModellingClient)

# build a new dataframe by login to the table "DASIM" which is included in three cloud based Opals
server <- c("study1", "study2", "study3")
url <- c("http://XXXXXX:8080")
table <- c("DASIM.DASIM1", "DASIM.DASIM2", "DASIM.DASIM3")
logindata <- data.frame(server,url,user="administrator",password="datashield_test&",table)

# login and assign the whole dataset
opals <- datashield.login(logins=logindata,assign=TRUE)

Questions

Use functions provided in DataSHIELD packages to solve the following problems:

Subsets and Statistics

Calculate the mean and the variance of the continuous variable BMI of obese males. 

Check the levels for the variables PM_BMI_CATEGORICAL and GENDER using ds.levels(). BMI is categorised in three levels: 1=normal, 2=overweight, 3=obese and gender is categorised in two levels: 0=male, 1=female.

Assign and Plots

2-dimensional contingency tables

Generalized Linear Models


When you complete the questions, check your answers and script.