Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
# load libraries
library(opal)
library(dsBaseClient)
library(dsStatsClient)
library(dsGraphicsClient)
library(dsModellingClient)

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)

 

Subsets and Statistics

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

...

Info
titleAnswer: Question 1
The global mean and the global variance of BMI are 33.04723 and 6.134642 respectively.

Assign and Plots

Find the quantile mean and plot a histogram of pooled data for the exponent and for the logarithm of LAB_HDL measurement.

...

Info
titleAnswer: Question 2 continued
Quantiles of the pooled data

                5%            10%            25%            50%                75%                90%

-0.06384112  0.06994799  0.26052368  0.44043450  0.58983773  0.71059831

             95%           Mean

 0.77301979  0.40754040


2-dimensional contingency tables

  • What percentage of females (pooled data) are diabetics?
  • What percentage of males in each study separately have stroke (DIS_CVA)?

...

Info
titleAnswer: Question 3 continued
The percentages of males having stroke are 0.82% in study 1, 0.80% in study 2 and 0.78% in study 3.
Code Block
languagexml
$counts
$counts$`study1-D$GENDER(row)|D$DIS_CVA(col)`
         0  1 Total
0     4955 41  4996
1     4979 25  5004
Total 9934 66 10000


$counts$`study2-D$GENDER(row)|D$DIS_CVA(col)`
         0  1 Total
0     4956 40  4996
1     4970 34  5004
Total 9926 74 10000


$counts$`study3-D$GENDER(row)|D$DIS_CVA(col)`
         0  1 Total
0     4960 36  4996
1     4976 28  5004
Total 9936 64 10000


$rowPercent
$rowPercent$`study1-D$GENDER(row)|D$DIS_CVA(col)`
          0    1 Total
0     99.18 0.82   100
1     99.50 0.50   100
Total 99.34 0.66   100


$rowPercent$`study2-D$GENDER(row)|D$DIS_CVA(col)`
          0    1 Total
0     99.20 0.80   100
1     99.32 0.68   100
Total 99.26 0.74   100


$rowPercent$`study3-D$GENDER(row)|D$DIS_CVA(col)`
          0    1 Total
0     99.28 0.72   100
1     99.44 0.56   100
Total 99.36 0.64   100


$colPercent
$colPercent$`study1-D$GENDER(row)|D$DIS_CVA(col)`
           0      1  Total
0      49.88  62.12  49.96
1      50.12  37.88  50.04
Total 100.00 100.00 100.00


$colPercent$`study2-D$GENDER(row)|D$DIS_CVA(col)`
           0      1  Total
0      49.93  54.05  49.96
1      50.07  45.95  50.04
Total 100.00 100.00 100.00


$colPercent$`study3-D$GENDER(row)|D$DIS_CVA(col)`
           0      1  Total
0      49.92  56.25  49.96
1      50.08  43.75  50.04
Total 100.00 100.00 100.00


$chi2Test
$chi2Test$`study1-D$GENDER(row)|D$DIS_CVA(col)`


                Pearson's Chi-squared test with Yates' continuity correction


data:  contingencyTable
X-squared = 3.4559, df = 1, p-value = 0.06302




$chi2Test$`study2-D$GENDER(row)|D$DIS_CVA(col)`


                Pearson's Chi-squared test with Yates' continuity correction


data:  contingencyTable
X-squared = 0.34846, df = 1, p-value = 0.555


$chi2Test$`study3-D$GENDER(row)|D$DIS_CVA(col)`


                Pearson's Chi-squared test with Yates' continuity correction



Generalized Linear Models

  • Apply a generalised linear model that predicts the level of glucose between males and females. What is the predicted average level of glucose for males? What is this value for females?
  • Apply a GLM to predict the level of glucose using gender and continuous bmi. How much the level of glucose is increasing with the increase of bmi by one unit? What is the predicted glucose level of a female with bmi=22?

...