gravatar

chetcorawn

Steve Grambow

Recently Published

CRP241 F24 Assignment 4
Here is the compile report of the R Code for Assignment 4
HM4-Problem5-Rscript.R
CRP241F23-Assignment4
Assignment 4 F23
Document
sp22 final exam crp245
R output from for final exam
CRP245SP22-Homework3-Rscript
CRP245Sp22 -- Homework 2
CRP245SP22-Homework1 R Code
R code for 1st homework
01-13-22_logistic-prostate_cancer
example from 01-13-22
CRP245SP22-01-10-22
1-10-22 Linear Regression Review
PRU and AFIB analysis
CRP241F21 final exam
crp241f21Assignment5
R code associated with assignment 5
crp241-assignment4
code for assignment 4
CRP241 - Assignment 1 Code
This code demonstrates how to accomplish the data management tasks that are in Assignment 1.
crp245-sp21-propensity-example
crp245-final-lasso-ridge
For question 9 and 10 on take-home examination
crp245-final-prevend-analyses
Final Assignment Data and Analyses
CRP245 ISLR Chapter 5 Lab
RStudio Lab exercises from the Introduction to Statistical Learning book. The authors have included R/RStudio lab exercises in each chapter. This the lab in Chapter 5 covering cross validation and bootstrap. Discussion of the labs is included in sections 5.3 in the book. The discussion generally in the book but include additional details about the R scripts. Chapter 5 Lab: Demonstrates, Cross Validation and Bootstrap
ISLR Chapter 6 Lab 1
# An Introduction to Statistical Learning with Applications in R # Chapter 6 Lab 1: Subset Selection Methods # Best Subset Selection # The goal here is to demonstrate best subset selection # to the Hitters data which includes variables related to # baseball performance. The goal is to predict a players # salary on the basis of these variables.
ISLR Chapter 6 Lab 2
# An Introduction to Statistical Learning with Applications in R # Chapter 6 Lab 2: Ridge Regression and the Lasso # We will use the glmnet package in order to perform ridge regression and # the lasso. The main function in this package is glmnet(), which can be used # to fit ridge regression models, lasso models, and more. This function has # slightly different syntax from other model-fitting functions that we have # encountered thus far in this book. In particular, we must pass in an x # matrix as well as a y vector, and we do not use the y ~ x syntax. We will # now perform ridge regression and the lasso in order to predict Salary on # the Hitters data.
crp245-part2-interaction
crp245-Part2-day5
linearity and PH assumption
crp245-part2-day3
RScript file examining regression diagnostics
Part 2 Day 2 Rscript
Handling Categorical Predictors Coding options; overall significance; Centering variables
Part2-Day1-FEV-Rscript
# -------------------------- # ~ CRP 245 Part 2 Day 1 ~ # -------------------------- # Example 1 -- Intuition about "Adjusted" Regression # FEV1 and Genetic Variation: # A study was conducted to determine if there was an # association between a genetic variant and forced # expiratory volume in one second (FEV1) in patients with COPD. # FEV1 was measured in liters. Genotypes of interest were wild # type vs. mutant (i.e. heterozygous or homozygous for risk # allele). Sex was also recorded. 100 patients were randomly # selected from the researchers clinical practice.
crp245sp21-part1day7 R Script
Walkthrough of Advanced Count Regression Issues and Models
part1_day6_Rscript.R
# ~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~ CRP 245 Part 1 Day 6 ~ # ~ Count Regression ~ # Number of Births Example: # A study was performed to describe the frequency of births. # Researchers were interested in determining whether the # number of births to women living in rural versus urban # areas differed. Researchers were able to recruit 49 women to # participate in the study. Working with the study participants # and their physicians, research retrospectively collected the # number births over a 3 year period.
crp245sp21-part1day5-cgd
# ~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~ CRP 245 Part 1 Day 5 ~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~ # Motivating Example: CGD Data # Data are from a placebo controlled trial of gamma interferon # in chronic granulotomous disease (CGD). Outcome of interest # is time to first serious infection observed through end of # study for each patient. # Data Set: cgd
bmj_logrank
# ~~~~~~~~~~~~~~~~~~~~~~~~~~ # BMJ Statistics Notes # Data from log-rank # article # ~~~~~~~~~~~~~~~~~~~~~~~~~~ # Bland, J. M., & Altman, D. G. (2004). # The logrank test. Bmj, 328(7447), 1073. # PDF link: https://www.bmj.com/content/bmj/328/7447/1073.full.pdf # Here is the dataset from the article along # with code to replicate analysis shown in article.
bmj_km
# Martin Bland, J., & Altman, D. G. (1998). # Survival probabilities (the Kaplan-Meier method). # British Medical Journal, 317(7172), 1572. # URL to PDF # https://www.bmj.com/content/bmj/317/7172/1572.full.pdf # Here is the dataset from the article along # with code to replicate KM plot shown in article.
CRP245sp21-part1-day4-ovarian2
# Ovarian Cancer Survival Data Example: # A randomized clinical trial was performed to # compare two treatments of patients with advanced # ovarian carcinoma (stages IIIB and IV) using # either cyclophosphamide alone (1 g/m2) or # cyclophosphamide (500 mg/m2) plus adriamycin # (40 mg/m2) by iv injection every 3 weeks.
crp245sp21-part1day3-hypertonic
# Nebulized Hypertonic Saline for Bronchiolitis # A Randomized Clinical Trial # Author: Wu et al. # Citation: # JAMA Pediatrics, 168(7), 657-63. # URL: https://doi.org/10.1001/jamapediatrics.2014.301
crp245sp21-part1day3-hypoxanthine
# ~ Hypoxanthine Data # ~ from: Analysis of # ~ Biological Data Ch 17 # ~ Problem 14 # ~ Reference: # ~ James, R. A., Hoadley, P. A., & Sampson, B. G. (1997). # ~ Determination of postmortem interval by sampling vitreous # ~ humour. American Journal of Forensic Medicine and # ~ Pathology, 18(2), 158-162. # ~ https://doi.org/10.1097/00000433-199706000-00010
crp245sp21-part1day2
This is the Rscript file for part1day2 of the course -- this session is focused on review of simple logistic regression. This script file performs basic logistic regression analysis of Fair's Affairs data.
crp245sp21-part1day1
# ~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~ CRP 245 Part 1 Day 1 ~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~
CRP241 - Module 4 Day 10
R script file for CRP241F20 Module 4 Day 10 Analysis of Cholesterol Data Example using paired t-test Analysis of Acupuncture Data using ANCOVA
CRP241F20 Mod4Day9 Interaction
RScript file for Interaction Discussion on 11/5/20
module4_day8_RScript.R
CRP241 -- Module 4 Day 7 Simple Linear Regression Example
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~ CRP 241 Module 4 Day 7 ~ # ~ Simple Linear Regression ~ # ~ Diagnostics ~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Body Fat Data: # Percentage of body fat, age, weight, height, and ten body circumference # measurements (e.g., abdomen, neck, ankle, etc.) are recorded for 252 men. # Body fat is estimated through an underwater weighing technique. # There are numerous variables in the lead dataset but those of interest for # the current exercise include: # 1. brobf : % Body Fat # 2. abdmn : Abdomen Circumference (cm) # 3. neck : Neck Circumference (cm) # 4. ankle : Ankel Circumference (cm) # 5. height : Height (in)
module2 Day 3 htwtkids Rscript
Data on Age, Weight, and Height of Children recorded for a group of school children. From Lewis and Taylor (1967). In this example, the weights of school children are modeled as a function of their heights and ages. Modeling is performed separately for boys and girls.
CRP245-mod2-day3-RScript
crp245-mod2-day-Rscript
Regression Diagnostics
CRP245-mod2-day1-RScript
Code from CRP245 module 2 day 1
CRP245-mod1day4-Rscript
Outline: What is survival analysis? Introduce terminology and data structure. Introduce inferential targets (expected time-to-event, survival and hazard functions). Introduce common approach for estimating the survival curve using observed data -- the Kaplan-Meier method
CRP245-mod1day3 Hypertonic Example
# Nebulized Hypertonic Saline for Bronchiolitis # A Randomized Clinical Trial # Author: Wu et al. # Citation: # JAMA Pediatrics, 168(7), 657-63. # URL: https://doi.org/10.1001/jamapediatrics.2014.301
CRP245-mod1day3 Hypoxanthine Example
James, R. A., Hoadley, P. A., & Sampson, B. G. (1997). Determination of postmortem interval by sampling vitreous humour. American Journal of Forensic Medicine and Pathology, 18(2), 158–162.
crp245-mod1day2 R Script Key
CRP245 Analysis Key for mod1day2 logistic regression analysis of the Affair data Fair's Affair Data Example: A cross-sectional study was performed to understand the factors that correlate with an individuals decision to engage in extramarital affairs. 601 individuals participated in the study. The response of interest was whether or not the subject engaged in any extramarital sexual relations at least once in the last 12 months. Researchers wanted to understand the relationship between a subjects decision to engage in an affair and the length of their marriage
mod1day1-updated
This updated version of the R Script file showing the BRFSS from mod1day1 contains additional code for visualizing confidence bands and prediction bands for the regression model.
CPR245mod1day1_RScript
# ~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~ CRP 245 Module 1 Day 1 ~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~ SCRIPT FROM CLASS SESSION ~ # ~ Annotated Solution Key ~ # ~ with added comments and ~ # ~ alternate possible coding ~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NEJM Peanut Allergy
This is a quick write-up of a case illustration examining the primary outcome analysis of an MEJM randomized trial of peanut consumption in infants at risk for peanut allergy. Du Toit, G., Roberts, G., Sayre, P. H., Bahnson, H. T., Radulovic, S., Santos, A. F., … Lack, G. (2015). Randomized trial of peanut consumption in infants at risk for peanut allergy. New England Journal of Medicine, 372(9), 803–813. https://doi.org/10.1056/NEJMoa1414850
water-pipe-smoking
This is a quick write-up of the case illustration we did in class on 11/14, examining water-pipe tobacco smoking among 3rd year medical students at the University of Sao Paulo School of Medicine. Martins, S. R., Paceli, R. B., Bussacos, M. A., Fernandes, F. L. A., Prado, G. F., Lombardi, E. M. S., … Santos, U. P. (2014). Experimentation with and knowledge regarding water-pipe tobacco smoking among medical students at a major university in Brazil. Jornal Brasileiro de Pneumologia, 40(2), 102–110. https://doi.org/10.1590/s1806-37132014000200002 We examined the participant responses to the survey question, “Have you ever smoked tobacco from a water pipe?” The survey responses were summarized in table 1 of the paper:
mod5day2
2 x 2 tables which will be discussed on mod5day2
module5-day1_Rscript.R
R Code for mod5-day1
Module4-day10_RScript
mod4day10 Rscript file output
Module 4 Day 9 Interaction Answers
Answer for mod4-day9 exercise using low birth weight data
Module4-Day9-Interaction
RScript code from mod4-day9 in 241 F19
Mod4-Day8 Confounding Answers
Answers for Lead Data Analysis
Mod4-Day6-7 RScript File
Script file for Simple Linear Regression
How is Regression Fit?
Illlustration of how a simple linear regression line is determined
Mod4-Day8 Confounding
Code associated with mod4-day8 lecture
mod4day1
Module 2 Day 3 Script KEY
Script file with answers for the exercises done in class on module 2 day 3 (9/16) looking at the small data set (dset1) with 8 variables, x1-x4 and y1-y4.
Mod2 Day2 KEY
This is the report for script and exercises we worked on during module 2 day 2 and 3
CRP245 Spring Final Analysis
final exam problem
Logisitc Regression Day 1 Code
Some code demonstrating analysis of Logistic Regression
Module 4 Day 6-7
Correlation and Simple Linear Regression