APPENDIX
A
Installation
In case you do not already have a LATEX installation, in Sections A.1 and A.2, we
describe how to install LATEX on your computer, a PC or a Mac. The installation is
much easier
Linear regression
Linear regression is probably the most heavily used piece of
statistical methodology
I
STAT 241 gives a good foundation
We will be looking at how to fit in R
1. How to fit the model
R Basic Plotting
R has near limitless potential for visualising data and fitted
models.
There is quite a learning curve to take advantage of Rs
graphical commands
I
The whole course could be written o
Optimization
In statistics, we often have the need to optimize a function
I
Maximize it
I
Minimize it
Example: regression
I
Matthew Schofield
How do we find the estimates for intercept and slope?
Slid
Course outline
Statistical computing is becoming increasingly important
We have two clear goals:
1. To become proficient at statistical programming and presenting
of results
2. To study some basic com
Data handling in R
To use R for data analysis
I
Matthew Schofield
We need data
Slide 1
R Data Handling
R has several builtin data sets which can be loaded by
calling data(datasetname).
Type data() at
R Functions
Goal: you become experts in translating mathematical
functions into (correct!) R code.
I
Already seen many functions built into R
I
Includes algorithms required for statistical inference
e
Loops and conditional statements in R
Considering a couple of very important skills:
1. Loops
for loops
while loops
2. If statements
Matthew Schofield
Slide 1
The if statement in R
In lecture 1 we e
Simulation and confidence intervals
Follow similar concepts to our last lecture:
I
Use simulation to learn about statistical procedures
Last lecture: sampling distributions
I
Know the value of the par
Simulation and statistics
Last lecture we considered simulation for probability
calculations
Transition into looking at quantities useful for statistics
Use simulation to learn about:
I
Randomness
I
E
Simulation
Over the next four lectures we will use simulation to answer
several probabilistic and statistical questions
I
Also called Monte Carlo method
Idea: use repeated random sampling to obtain nu
Simulation and power
Continue similar concepts to last two lectures:
I
Done: sampling distributions
I
Done: coverage
Today: power
I
Matthew Schofield
Hypothesis testing
Slide 1
Review: Hypothesis Test
LATEX and knitr
Today we will be learning about LATEX and knitr
LATEX
I
(pronounced Laytek)
Popular word processor in the sciences
knitr
I
Brings together LATEX and R
I
Used to produce reproducible
CHAPTER
15
Customizing
LATEX
In Section D.1.2, we discuss that Donald E. Knuth designed TEX as a platform on which
convenient work environments could be built. One such work environment, LATEX,
predom
Outline
1
Last Lecture
2
Least Squares Estimation
3
Linear Functions of Random Variables
June 16, 2015
1 / 18
Last Lecture
last Lecture
Definition: The model Y = X + where Y is an (n 1) random vector,
CHAPTER
11
The AMS article
document class
In this chapter, we discuss amsart, the main AMS document class for journal articles.
The AMS book document class is discussed in Chapter 18.
In Section 11.1,
Outline
1
Last Lecture
2
Linear Model
3
Least Squares
4
Example
5
Matrix Formulation
June 16, 2015
1 / 18
Last Lecture
Last Lecture
Models used by statisticians to depict the process that we believe
g
Previous Lectures
I
Hypothesis testing based on a teststatistic that has a known
distribution under H0 .
I
NeymanPearson introduced the idea of alternative hypotheses
I
Assumed that one of H0 or Ha
STAT 362
Assignment 1, 2015
Due Date: 6pm, Wed 22 July
Answer all questions on a separate document. Please use complete sentences
and type up your answers for all questions. Hand written work will NOT
Last Lecture 1.
I
I
Statisticians use data + model to make inference about
unknown quantities (parameters etc)
Frequentist inference is based on procedures chosen to have
good longrun frequency prope
Models and Data
I
I
Statisticians model data as a device for drawing conclusions
about things that are not observed
Model expressed in terms of parameters
 Numbers that characterize the population in
Last Lecture
I
I
Can readily extend LRT to test a null hypothesis about
restrictions on several parameters simultaneously
Define parameter space .

set of parameter values admissible under H0
 set
STAT362 Midterm Test 2015
Q1. Suppose we want to fit a regression line for data y1 , . . . , yn using the
model yi = 0 + 1 xi + 2 x3i + i , where the i s are assumed to have a
zero mean and constant v
Last Lecture 1.
I
If = (1 , . . . , p )0 , the density function for a set of random
variables Y is a member of the exponential family of
distributions if it can be written as
f (y : ) = a()b(y ) exp
k
STAT 362
Assignment 5, 2015
Due Date: 6pm, Wed 16 September
Answer all questions on a separate document. Please use complete sentences
and type up your answers for all questions. Hand written work wil
STAT 362
Assignment 2, 2015
Due Date: 6pm, Wed 5 August
Answer all questions on a separate document. Please use complete sentences
and type up your answers for all questions. Hand written work will NO
STAT362 Midterm Test 2014
Q1 Suppose we want to fit a regression line that is cubic in x and forced
through the origin for data y1 , . . . , yn using the model yi = x3i + i ,
where the i are all assum
Last Lecture
Theorem 19.1
I
If Y has probability (density) function fY (y ; ),
I
If the regularity conditions hold,
h
i
2 with 1 df
Under H0 : = 0 T = 2 lnL(0 ) ln L()
in large samples,
I
 is the ML