A back to back barplot from scratch This example is shown in Figure 3.30 in Paul Murrell's R Graphics book. Also, be aware of the Hmisc package's histbackback() function ...
Cole Beck's Baseball data set problem The goal of this problem was to 'reshape' the original data set (bos_pit.csv) to the desired data set. * bos_pit.csv The following ...
Block Randomization with Random Block Sizes The following code illustrates how to generate the randomization treatment assignments for a randomized clinical trial ...
Adding a 'broken axis' to a plot We've all seen a plot with a 'broken axis' e.g., the axis goes from 0 to 9 in units of 1, then shows a 'break' (//) and then continues ...
A plot that illustrates the effect of categorizing continuous covariates in a logistic regression model The idea behind this problem is the fact that fitting a categorized ...
Charles Dupont Misc List * wrote twiki session cleanup plugin * created means to automaticaly protect resticed files in twiki pub dir * modified backup script ...
Biostatistics for Clinical Pharmacology Fellows Instructors: Chris Slaughter and Frank Harrell Course page: http://biostat.mc.vanderbilt.edu/ClinStat Course Goals ...
Clinical and Health Research Clinic Click here for 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, and before. Current Notes (2023) 2023 December 7 Tara ...
Biostatistics Clinics All Biostatistics clinics will be held via teleconference (Microsoft Teams) and walk in attendance is no longer permitted. Monday Friday Noon ...
A function that displays the colors you can specify using the colors() function R has 657 built in colors that can be accessed using the colors() function. Invoking ...
Generating a complex table of drug, disease, and phase Synopsis of Problem: * Trying to create a table which lists the drugs and diseases for a given phase or combination ...
Course Goals * Learn how to use modern regression methods to answer scientific questions * Become familiar with statistical concepts including exploratory data ...
Rafe's problem d = data.frame(doc = c(1,2,3,2,2,3,4,6,5,5), prepost= c(0,0,1,1,1,0,0,1,0,1)) d =d order(d$doc), uu = function(u){ u = unique(u) if (length ...
Preparing data for survival analysis Our original data file, temp.csv, has repeated glucose values for each subject (DeID) at various times points (Time) from both ...
Rafe's Dataset Reshape Problem Rafe posed the following problem. The original data set had three measurements for each 'specimen' (spec). The goal was was to turn ...
The generic datadensity() function The datadensity() function is a generic functions used to show data densities in more complex situations. There are two class specific ...
Survival analysis with the survival and Design packages The following are some examples of how to perform survival analysis using the survival and Design packages ...
A function that returns the desired output from another function Often, you do not want to return all of the default output from a specific function. The following ...
Drawing outside of the plotting region In R, traditional graphical output is usually 'clipped' to the plotting region. In other words, any output that would appear ...
Emacs and ESS EmacsSpeaksStatistics more Emacs is an incredibly powerful text editor. It can be programmed to do anything. It was written before the advent of ...
Generating multiple regression models in a for loop Often, we wish to generate multiple regression models that are all similar, but all different. For example, all ...
Using the Hmisc package's summary.formula() function This following is an illustration of the many uses of the Hmisc package's summary.formula() function. The sample ...
How To Pages on the Biostatistics Wiki We are quickly building a lot of useful how to pages on our site. This page should help you find the pages you need quickly ...
Using the layout() function to generate multiple plots The par() function's mfrow= argument is often used to generate multiple plots on one page. However, as you ...
Generating data structures in a memory efficient manner We often generate data structures, such as vectors or data frames, in for loops or in our own used defined ...
Recommendations, Analyses, and Data for Health Services Research, Diagnosis, and Prognosis Clinic Notes 2020 2020 12 14 Santiago Angaramo (Dolly Padovani Claudio ...
Recommendations, Analyses, and Data for Health Services Research, Diagnosis, and Prognosis Clinic Notes 2021 2021 November 29 Megan Lancaster (Dan Roden), Cardiology ...
Plot the Kaplan Meier (K M) curves from two different K M calculations on the same plot The motivating data set for this example is the Rtestdata.sav SPSS data set ...
Coding factors with numerical levels instead of character ones Problem: Often times, the categorical variables in our read in data set have character denoted levels ...
Converting dates of the form 'mddyy', 'mddyyyy', 'mmddyy', or 'mmddyyyy' to the form 'YYYY MM DD' Problem: A data file contains multiple date columns, whose format ...
Plotting linear model results Often times, you would like to generate graphics based on a model you fit in R. These plots may include a number of diagnostic plots ...
How to write your own functions and good R programing techniques Good R Programing Techniques R is quite different from regular programing languages in the way that ...
Making Dot Charts in R Rachel Hayes brought a problem to R Clinic on 23Oct08. The Hmisc Dotplot function can produce multi panel dot charts with error bars while ...
Using the Hmisc plsmo Function for Plotting Nonparametric loess Trend lines R Clinic 23Oct08 The following examples use a new Titanic passenger and group survival ...
R Programming ProgrammingTipsForStatisticians Google's R style guide Handouts and Online Books * S Poetry and R Inferno by Patrick Burns by Patrick J. Burns ...
Converting dates of the form 'mddyy' or 'mddyyyy' or 'mmddyy' or 'mmddyyyy' to the form 'YYYY MM DD' Theresa A Scott, M.S. Biostatistician II, Department of Biostatistics ...
Plot the odds ratios (ORs) for a specific covariate from different logistic regression models Perhaps you are interested in the effect of a specific covariate from ...
Distinguishing a second categorical variable by color in a stripchart across groups For this example, I generated a dummy data set containing repeated measures I ...
An alternative to 'dynamite plots' (i.e., a bar depicting the mean, with a line depicting the standard deviation or error) We've all seen various examples of 'dynamite ...
Finding the sum of repeated continuous variables for each subject Suppose you have a data set with repeated measures i.e., you have multiple values of a continuous ...
Sweave knitr and LaTeX Introduction and Helpful Templates: The following will help you start to learn and use knitr Sweave and LaTeX: * rlatex GitHub project: ...
Theresa Scott's Teaching Material An Introduction to the Fundamentals Functionality of the R Programming Language * Scott.IntroToR.I.pdf: Part I: An Overview ...
Incorporate the third contrast of a three level categorical predictor into the odds ratio summary plot of a logistic regression model In any regression model, by default ...
Data and Analysis for Clinical and Health Research Clinic Notes (2018) 2018 December 20 Stephen Halliday, Allergy, Pulmonary, Critical Care Medicine * We have ...
Clinical and Health Research Clinic Notes (2023) 2023 December 7 Tara Helmer, VICTR We are working with a PI who wants to use My Health at Vanderbilt to recruit ...
Outline for Linux Workshop January 26, 2005 January 25, 2006 January 30, 2008 Note that the 2007 version of this workshop can be found at MoreTwikiWorkShop. ...
Generating a variable that correctly labels each subject's records as their first, second, etc. visit according to a visit date The idea behind this problem is that ...
Writing a list of vectors to a file Suppose you have a list whose components are vectors of different length, such as: a Here's how you can write the list to a file ...