Description Usage Arguments Value Examples
Function that will allow for (apply) to be used for linear regressions This function will do a single linear regression and extract the coefficients from the regression.
1 2 | lm_test(lm_data, count, covariates = "", correct_for = "",
outlier_sd = 3, omit.outlier = T)
|
lm_data |
Our dependent variables. Column = dependent variable, rows = observations (in this case, individuals) (numeric vector) |
count |
Our independent variable (numeric vector) |
covariates |
Covariates associated with each individual. Columns = covariates, rows = observations. (data.frame) |
outlier_sd |
Outliers that are greater than outlier_sd standard devs from the mean will be filtered out |
to_correct |
A string containing additional covariates to correct for. ex: '+as.factor(covariates$DTHHRDY)+as.factor(covariates$RACE)' |
Coefficients from the regression
1 | subcut_lm_results <- apply(subcut_for_test, 2, lm_test, count = MT_count, covariates = covariates, correct_for = '+ as.factor(covariates$GENDER) + as.numeric(covariates$AGE)+ as.numeric(covariates$smrin) + as.factor(covariates$smcenter) + as.factor(covariates$RACE)+ as.numeric(covariates$TRISCHD) +as.factor(covariates$COHORT) + as.factor(covariates$DTHHRDY) + covariates$PC1 + covariates$PC2 +covariates$PC3+ covariates$PC4 + covariates$PC5')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.