ds.tTestF: Runs a combined GLM analysis of non-pooled data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/ds.tTestF.R

Description

A function fit generalized linear models

Usage

1
2
3
ds.tTestF(formula = NULL, data = NULL, family = "gaussian",
  offset = NULL, weights = NULL, checks = FALSE, maxit = 15,
  CI = 0.95, viewIter = FALSE, datasources = NULL)

Arguments

formula

a character, a formula which describes the model to be fitted

data

a character, the name of an optional data frame containing the variables in the formula. The process stops if a non existing data frame is indicated.

family

a description of the error distribution function to use in the model

offset

a character, null or a numeric vector that can be used to specify an a priori known component to be included in the linear predictor during fitting.

weights

a character, the name of an optional vector of 'prior weights' to be used in the fitting process. Should be NULL or a numeric vector.

checks

a boolean, if TRUE (default) checks that takes 1-3min are carried out to verify that the variables in the model are defined (exist) on the server site and that they have the correct characteristics required to fit a GLM. The default value is FALSE because checks lengthen the runtime and are mainly meant to be used as help to look for causes of eventual errors.

maxit

the number of iterations of IWLS used instructions to each computer requesting non-disclosing summary statistics. The summaries are then combined to estimate the parameters of the model; these parameters are the same as those obtained if the data were 'physically' pooled.

CI

a numeric, the confidence interval.

viewIter

a boolean, tells whether the results of the intermediate iterations should be printed on screen or not. Default is FALSE (i.e. only final results are shown).

datasources

a list of opal object(s) obtained after login to opal servers; these objects also hold the data assigned to R, as a dataframe, from opal datasources.

Details

It enables a parallelized analysis of individual-level data sitting on distinct servers by sending

Value

coefficients a named vector of coefficients

residuals the 'working' residuals, that is the residuals in the final iteration of the IWLS fit.

fitted.values the fitted mean values, obtained by transforming the linear predictors by the inverse of the link function.

rank the numeric rank of the fitted linear model.

family the family object used.

linear.predictors the linear fit on link scale.

Author(s)

Burton PR; Gaye A; LaFlamme P

See Also

ds.lexis for survival analysis using piecewise exponential regression

ds.gee for generalized estimating equation models

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## Not run: 

# # load the file that contains the login details
# data(glmLoginData)
#
# # login and assign all the variables to R
# opals <- datashield.login(logins=glmLoginData, assign=TRUE)
#
# # Example 1: run a GLM without interaction (e.g. diabetes prediction using BMI and HDL levels
# # and GENDER)
# mod <- ds.glm(formula='D$DIS_DIAB~D$GENDER+D$PM_BMI_CONTINUOUS+D$LAB_HDL', family='binomial')
# mod
#
# # Example 2: run the above GLM model without an intercept
# # (produces separate baseline estimates for Male and Female)
# mod <- ds.glm(formula='D$DIS_DIAB~0+D$GENDER+D$PM_BMI_CONTINUOUS+D$LAB_HDL', family='binomial')
# mod
#
# # Example 3: run the above GLM with interaction between GENDER and PM_BMI_CONTINUOUS
# mod <- ds.glm(formula='D$DIS_DIAB~D$GENDER*D$PM_BMI_CONTINUOUS+D$LAB_HDL', family='binomial')
# mod
#
# # Example 4: Fit a standard Gaussian linear model with an interaction
# mod <- ds.glm(formula='D$PM_BMI_CONTINUOUS~D$DIS_DIAB*D$GENDER+D$LAB_HDL', family='gaussian')
# mod
#
# # Example 5: now run a GLM where the error follows a poisson distribution
# # P.S: A poisson model requires a numeric vector as outcome so in this example we first convert
# # the categorical BMI, which is of type 'factor', into a numeric vector
# ds.asNumeric('D$PM_BMI_CATEGORICAL','BMI.123')
# mod <- ds.glm(formula='BMI.123~D$PM_BMI_CONTINUOUS+D$LAB_HDL+D$GENDER', family='poisson')
# mod
# 
# # clear the Datashield R sessions and logout
# datashield.logout(opals) 


## End(Not run)

datashield/dsBetaTestClient documentation built on Nov. 7, 2019, 5:40 p.m.