STA 250: Statistics
Notes 8. Inference with Bayes: Prediction
Book chapters: (11.1-2 relate to the last part)
1
Predict instead of testing
Example (TC count trend.). Recall the annual TC count example where we model TC
IND
counts X = (X1 , , Xn ) from las
STA 250: Statistics
Notes 16. Large scale testing and multiplicity correction
Book chapters:
1
Background: t-tests in microarray association studies
The advent of microarray technology has made it possible to simultaneously measure the
expression levels
STA 250: Statistics
Notes 15. Comparing two normal populations
Book chapters: 9.6
1
Background
A large number of statistical applications boil down to comparing two populations through
their means. For example, suppose you have to decide which of the two
STA 250: Statistics
Notes 14. Bayes Testing
Book chapters: 9.8
1
Bayes testing
The basic goal of testing is to provide a summary of evidence toward/against a hypothesis
of the kind H0 : 0 (against H1 : 1 = \ 0 ), for some scientically important
subset 0 .
STA 250: Statistics
Notes 20. Testing Goodness of Fit
Book chapters: 10.1-2
1
How good is a model?
So far in our course we have always accepted a given statistical model to describe our
data. Can we ascertain whether a model is adequate for the data we ob
STA 250: Statistics
Notes 18. Chi-square tests for Independence, Goodness-of-t
Book chapters: 10.4
1
Two-way tables: category counts based on two attributes
Hair color
A two-way contingency table is a special kind of categorical data where n units are spl
STA 250: Statistics
Notes 17. Category Counts Data
Book chapters: 10.3
1
Category counts data
A great deal of social and biological science studies involve category count data. We have
seen the simplest example of this in our opinion poll study, where a r
STA 250 - Statistics
Lab 6
October 7, 2015
Introduction
In this session, we focus on the Gibbs sampling algorithm. The motivation is to draw random samples from
some complicated multivariate distributions.
1
Gibbs sampling.
Let f (w, v) be a bivariate pdf
STA 250 - Statistics
Lab 1
August 26, 2015
Introduction
This lab is intended to be an introduction to the software R. This document contains a description of the
basic functionality of R, along with a series of tasks that should be submitted.
1
What is R?
# 1. Packages
# Two ways to install the packages
# First, Tools > Install Packages > enter the name of the package you wish to run
# Second, install the packages in Console
# Step 1: Install the package
install.packages("dplyr")
# Step 2: load the package
# Lab for Statistical Sleuth, Chapter 18 (Vitamin C Data)
# STA 210, Duke University
# 23 March 2015
#Load sleuth
library(Sleuth3)
#Process this data frame that is poorly made
View(case1802)
df <- case1802[,2:3]
rownames(df) <- c("Placebo","Treatment")
#D
library(Sleuth3)
library(mosaic)
#Load the data set
d = case2202
View(d)
#Model with a poisson link
glm = glm(Salamanders ~ PctCover + ForestAge,d,family=poisson)
#What kind of habitats do salamanders prefer?
#Upload your code and short writeup to Sakai u
STA 250: Statistics
Notes 19. Linear Regression
Book chapters: 11.1-4
1
Introduction
A most widely used statistical analysis is regression, where one tries to explain a response
variable Y by an explanatory variable X based on paired data (X1 , Y1 ), , (X
Common probability distributions
pdf/pmf
px (1 p)1x
(n) x
nx
x p (1 p)
Distribution
Bernoulli(p)
Binomial(n, p)
x
e
x!
Poisson()
1
e
2 2
Normal(, 2 )
(x)2
2 2
Variable
x = 0 or 1
Parameters
0<p<1
Mean
p
Variance
p(1 p)
x = 0, 1, , n
0<p<1
np
np(1 p)
x =
STA 250: Statistics
Notes 9. Conjugate Analysis of Standard Models
Book chapters: 7.3
1
Conjugate prior family
Once we get a posterior pdf/pmf (|x) by combining a model X f (x|) with a prior
pdf/pmf () on , a report can be made by summarizing the posterio
STA 250: Statistics
Notes 5. Choosing Test Statistic: the Maximum Likelihood Approach
Book chapters: 7.5,7.6
1
Choice of Test Statistic: Neyman-Pearson Lemma
Last week we discussed about choosing the cut-o c for a testing rule reject H0 if T (x) > c
when
STA 250: Statistics
Notes 6. Standard ML tests
Book chapters: 7.6
1
ML test for normal model with known variance
Consider the model X1 , , Xn Normal(, 2 ) where is known and (, ) is the
unknown model parameter. Let us start by characterizing for any b > 0
STA 250: Statistics
Notes 12. Stochastic Computing
Book chapters: 12.2, 12.4
1
Sampling and Monte Carlo
Laplace approximation is a wonderful mathematical tool, but it has several limitations. It
fails to provide an adequate approximation when the target p
STA 250: Statistics
Notes 10. Prior Selection: Contextual and Default Choices
Book chapters:
1
How do we choose a prior for our analysis?
In a Bayesian analysis, the only choice the analyst has to make is the prior selection. We will
avoid, for now, disc
STA 250: Statistics
Notes 4. Classical Theory of Testing
Book chapters: 8.4, 9.5
1
The power function
Recall the drug eectiveness study where we model increase in sleep hours X1 , , Xn of
IID
n = 10 patients by Xi
Normal(, 2 ), (, ), > 0. We looked at th
STA 250: Statistics
Notes 7. Bayesian Approach to Statistics
Book chapters: 7.2
1
From calibrating a procedure to quantifying uncertainty
We saw that the central idea of classical testing is to provide a rigorous calibration of how a
testing rule reject H
STA 250: Statistics
Notes 2. Statistical Models and Inference Formulation
Book chapters: 7.1
1
Describing Data & Statistical Models
A physicist has a theory that makes a precise prediction of whats to be observed in data. If
the data doesnt match the pred
STA 250: Statistics
Notes 1. Recap of Probability & Basic Math
Book chapters: 1-6
1
Uncertain quantity vs. random variable
In probability theory, we are familiar with using pdfs and pmfs to describe a random variable.
The term random variable carries a ce
STA 250: Statistics
Notes 3. Hypotheses testing
Book chapters: 9.1, 9.5
1
Hypotheses about model parameters
A new soporic drug is tried on n = 10 patients with sleep disorder, and the average
increase in sleep hours is found to be 2.33 hours (with standar
STA 250: Statistics
Notes 11. Laplace Approximation to the Posterior
Book chapters:
1
Non-conjugate prior and diculty with posterior computation
While conjugate priors make computation easy, they may not be always appropriate and
sometimes they simply do
STA 250: Statistics
Notes 13. Classical Interval Reporting: Condence Intervals
Book chapters: 8.5
1
Cross-connecting classical testing and Bayesian prediction
In the rst two modules, we got introduced to the classical and the Bayesian approach to
statisti