cox.modl: Cox Model Wrapper Function

Description Usage Arguments Details Value Examples

View source: R/cox-array.R

Description

This function serves to wrap the survival coxph function for easier usage in evaluating many cox models simultaneously. This function is accessed by cox.arry() in order to parallelize the univariate comparisons of every protein against the outcome.

Usage

1
2
3
4
5
6
7
8
cox.modl(
  .data,
  time = "fuptime",
  outcome = "hfdiag",
  protein,
  .adjust = adjust,
  extend = 100
)

Arguments

.data

The data tibble containing the variables to be regressed.

time

A character vector of the outcome variable time to event

outcome

A character vector of the outcome variable event indicator

protein

A character vector indicating which protein is being regressed.

.adjust

A vector of all adjustment variables for this model.

extend

Number of asterisks to add to Pvalue table indicator.

Details

This function returns the effect estimate for the "protein" of interest adjusted. The function also creates a string descriptor to print output as table for .csv files. The significance of the p value is indicated by each marker denoting a power of ten smaller.

Value

A list with three components:

hazr

The Hazard Ratio of the Protein

cint

A Vector of length 2 with Lower and Upper Confidence Interval

pval

The P value of the model covariate

desc

A string that combines the relevant information (such as hazard ratio and confidence interval) needed to display in a table.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 

  data <- haven::read_dta('~/proteomics/studydata.dta')

  cox <- cox.modl(data, time = 'adjudhfdate', outcome = 'adjudhf_bwh',
                  protein = 'SeqId_7655_11', .adjust = adjust)


## End(Not run)

pranavdorbala/proteomicsHF documentation built on March 9, 2021, 12:22 a.m.