- Syllabus
- Diese Vorlesung ist in English: German Coast Guard
- Discrete Distributions in R (best viewed in Tinn-R or some other editor)
- Exploratory analysis with categorical data: R and Categorical Variables
- Inference (Test, CI, Power) for a single proportion: R code for inference about single proportion
- First Homework: HW1
- Please fill out this survey (only one question!)
- R code from class on Friday, Nov. 14: Simulate Coverage Probability for Wald Confidence Interval for a single proportion
- R code from class on Friday, Nov. 21: exactTest
- Homework 2 is due next week Friday (Dec. 5th)!
- Here is an outline of the Solution to HW1
- Exact inference for a single multinomial: exactmultinomial
- In class, someone asked about R code for the highest posterior density Bayesian credible interval. The hpd function in the TeachingDemos library can construct HPD intervals from a posterior distribution. (The package hdrcde is a more sophisticated package for such methods.) Example:
> library("TeachingDemos") > n <- 12 > y <- 7 > a <- 1 > b <- 1 > h <- hpd(qbeta, shape1=y+a, shape2=n-y+b) > h [1] 0.3232160 0.8144068
> # compare to equal tailed: > qbeta(c(0.025,0.975), shape1=y+a, shape2=n-y+b) [1] 0.3157776 0.8077676
- Homework 3 (due next week Friday; final version with one more problem added and one typo in exercise 2 corrected; thanks to some of you for pointing this out):HW3
- Solutions to HW 2 (updated!!): Solution_HW2
- Solutions to Homework 3
- Inverting score tests for inference on difference of two independent proportions: Overview
- R code to get the score confidence interval for the difference of two independent binomial proportions: score_int_diff_2props
- R code for the exact confidence interval for the difference of two independent proportions:AgrestiMin (needs to be updated)
- Handout: Chi-squared tests
- Some Historical Notes: Controversies about odds ratio or degrees of freedom (Pearson vs. Yule or Fisher)
- Permutation Test for two-way contingency tables: Permutation tests for independence in general r x c tables
- Homework 4 (due next Thursday!): HW4
- Practice for the final exam: Quiz1
- Fisher’s Exact Test online.
- General Permutation test of independence online (using Monte Carlo sampling)
- GEE analysis of cross-over trial (see lecture notes) with high and low dose:
subj <- rep(1:86,each=2) dose <- rep(c(1,0),86) # 1 means high, 0 means low resp <- c(rep(c(1,1),53),rep(c(1,0),16),rep(c(0,1),8),rep(c(0,0),9)) #from contingency table counts mydat <- data.frame(subj=subj,dose=dose,resp=resp) require("gee") #Fit GEE model with exchangeable working correlation structure fit_exch <- gee(resp~dose, family=binomial,id=subj, data=mydat ,corstr = "exchangeable") summary(fit_exch)
- GEE modeling for depression data set
- Dataset (as .txt file):depression
- R code with output: GEE_depression
- R source code: depression_sourceCode
- HW5 is online and due next week Tuesday (this is the final version, with the GEE problem posted). Exercise 1 refers to this document on drug safety. Exercise 3 refers to this data set: Relief of Dysmenorrhea
- Here are some more practice exercises (updated to correct typo): Quiz2
- Cochran-Mantel-Haenszel Analysis
- Smoking dataset: smoking.csv
- R output of analysis of smoking data: CMH
- Source Code: CMH_sourceCode
- Partial Solution to HW5 (GEE example):Solution_HW5
- Linear Discriminant Analysis R code: LinDiscriminantAnalysis_LDA
- Take Home portion of Final Exam (due Friday, Feb. 6th at the latest). Please hand it in at the “Sekretariat” of the Institute of Statistics or give it to me when I’m in my office.)
- Statistical Learning: Free download of book pdf. (for regression trees later in the course)
- Exact tests for multinomial probabilities: exact_multinomial_tests
- Homework 2: HW2
- Comparing two proportions: R code for inference about two proportionsR code for Chi-squared tests for independence & homogeneity:R code for inference about several proportions
- R code for score confidence interval: score_int
- Homework 3: HW3
- In-Class part of Midterm 1:
- Take Home part of Midterm 1 (due Friday, March 29th):
- Logistic Regression in R: shuttle
- Space shuttle data set: challenger
- View of Launch Pad:
- Wiki entry of the Challenger disaster
- Horseshoe Crab data: crabHomework 4: HW4
- Wiki entry
- R code: Horseshoe
- Multinomial Response Models:
- Alligator data set: alligator
- R code to fit baseline category model: alli
- Pneumonia in coalminers data set:coalminers
- R code for cumulative logit models: Rcode_coalminers
- Another cumulative logit model: Mental depression
- Loglinear Models:
- For Contingency Tables: Alc-Cig-Mar use: alccigmar
- Not covered: Models for repeated binary observationsHomework 5: HW5
- Depression data: depression
- R code for GEE (and GLMM) with depression data: Rcode_depression
- Depression data: depression
- Final Exam (due next Friday):