Versions Compared

Key

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

The answers and suggested code below are for the extended practical session that allows you to implement basic DataSHIELD functions and interpret the results. 

Code Block
languagexml
# load libraries
library(opal)
library(dsBaseClient)
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)

...

Tip
titleAnswer: Question 4 continued

The

level

of

glucose

related

to

gender

and

bmi

is

given

by

the

formula:
LAB_GLUC_FASTING=3.64750965-0.07493214*GENDER+0.03543909*PM_BMI_CONTINUOUS

While

the

level

of

bmi

is

increasing

by

one

unit,

the

level

of

glucose

isincreasing

is increasing by

0.03543909. 

For

a

female

(GENDER=1)

with

PM_BMI_CONTINUOUS=22,

the

level

of

glucose

should

be


3.64750965 - 0.07493214 * 1 + 0.03543909 * 22 = 4.352237

Code Block
languagexml
 $formula
[1] "D$LAB_GLUC_FASTING ~ 1 + D$GENDER + D$PM_BMI_CONTINUOUS"


$family
Family: gaussian
Link function: identity


$coefficients
                                 Estimate           Std. Error          z-value              p-value     low0.95CI
(Intercept)        3.64750965   0.0237582722  153.525880 0.000000e+00  3.60094429
GENDER1           -0.07493214 0.0079817991  -9.387876    6.122208e-21  -0.09057618
PM_BMI_CONTINUOUS  0.03543909 0.0008390991  42.234690 0.000000e+00  0.03379449
                            high0.95CI
(Intercept)        3.6940750
GENDER1          -0.0592881
PM_BMI_CONTINUOUS  0.0370837


$dev
[1] 14307.08


$df
[1] 29997


$nsubs
[1] 30000


$iter
[1] 3


attr(,"class")
[1] "glmds"


...