glmAnalysis: Perform generalized linear model analysis to estimate effect...

Description Usage Arguments Details Value Examples

View source: R/glmAnalysis.R

Description

A function that performs generalized linear model analysis to estimate effect size.

Usage

1
2
3
glmAnalysis(value = "value", variableOfInterst = "Subject Age", parameter,
  otherVariables = c("Gender"), studyID = "study", label = "label", data,
  CILevel = 0.95, ifScale = c(TRUE, FALSE))

Arguments

value

A string to specify the column name of the dependent variable (y)

variableOfInterst

A string to specify the column name of the independent variable of interest (x1)

parameter

A string to specify what summary statistics is the dependent variable.

otherVariables

A string vector to specify the column names of independent variables included in the regression model other than the variableOfInterst.

studyID

A string to specify the column name of study ID.

label

A string to specify the name the column that contains the cluster label or name.

data

A data frame containing the data. Usually a long form data frame returned by collectData.

CILevel

A number between 0 to 1, used to specify the confidence levels. e.g. 0.95 represent 95 percent confidence interval.

ifScale

A vector of two logic values, specifying if the dependent variable and the variableOfInterst should be scaled when calculating the effect size.

Details

The function use the model value ~ variableOfInterst + otherVariables + studyID to estimate the effect size. Use it as a screening tool. Use metaAnalysis function to analyze an effect size in more detail.

Value

Returns data frame describing the overall effect size of variableOfInterst on value. May be slightly different from the value reported from the function metaAnalysis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(dplyr)
#collect all summary statistics
fn=system.file("extdata","",package="MetaCyto")
files=list.files(fn,pattern="cluster_stats_in_each_sample",
                recursive=TRUE,full.names=TRUE)
fcs_stats=collectData(files,longform=TRUE)
# Collect sample information
files=list.files(fn,pattern="sample_info",recursive=TRUE,full.names=TRUE)
sample_info=collectData(files,longform=FALSE)
# join the cluster summary statistics with sample information
all_data=inner_join(fcs_stats,sample_info,by="fcs_files")
# See the fraction of what clusters are affected by
# age (while controlling for Gender)
GA=glmAnalysis(value="value",variableOfInterst="Subject Age",
              parameter="fraction",
              otherVariables=c("Gender"),studyID="study_id",label="label",
              data=all_data,CILevel=0.95,ifScale=c(TRUE,FALSE))

MetaCyto documentation built on Nov. 8, 2020, 7:50 p.m.