Week 1
L2 One sample t-test
L3 Paired sample t-test and Z-test
Week 2: Hypothesis test
L4 Critical value and rejection region
L5 Power and sample size
L6 Confidence intervals
Week 3: One sample non-parametric test on mean
L7 Non-parametric tests: binomial
STAT2012 Statistical Tests
sydney.edu.au/science/maths/stat2012
Semester 2, 2016
Solutions
Computer Lab Exercises 2
Last compiled: August 19, 2016
Questions
1. Suppose that x contains a sample of size 6 (data: 2,4,6,5,7,1) from a
normal population. Test H
STAT2012 Statistical Tests
sydney.edu.au/science/maths/stat2012
Semester 2, 2016
Solutions
Computer Lab Exercises 3
Last compiled: August 8, 2016
Exercises
1. Access the data survey, and set a variable pulse.sf to be the pulse
among female students who sm
STAT2012 Statistical Tests
sydney.edu.au/science/maths/stat2012
Semester 2, 2016
Solutions
Computer Lab Exercises 1
Last compiled: July 12, 2016
Questions
1. Enter x=c(2.7,5.3,-4.7,7.0,1.7) into the R chunk below, and then on the
next line type x to displ
The University of Sydney
STAT2012 Statistical Tests
Semester 2
Computer Practice Week 11
2016
Useful R commands
Regression model:
iid
If Yi = + xi + i , i = 1, . . . , n where i N (0, 2 ), the ANOVA table for the test
H0 : = 0 vs H1 : 6= 0
of the signifi
The University of Sydney
STAT2012 Statistical Tests
Semester 2
Computer Practice Week 9
2016
Useful R commands
Friedman test for 2-way data without replicates:
To test the hypotheses on treatment effects,
H0 : 1 = = c vs H1 : at least one j does not equa
The University of Sydney
STAT2012 Statistical Tests
Semester 2
Computer Practice Week 10
2016
Useful R commands
Regression model:
iid
If Yi = + xi + i , i = 1, . . . , n where i N (0, 2 ), the least squares estimates
and
can be obtained by
lsfit(x,y)$
The University of Sydney
STAT2012 Statistical Tests
Semester 2
Computer Practice Week 8
2016
Useful R commands
Two-way ANOVA test: To test
H0 : 1 = = c vs H1 : at least one j does not equal; and/or
H0 : 1 = = r vs H1 : at least one i does not equal;
the
The University of Sydney
STAT2012 Statistical Tests
Semester 2
Computer Practice Week 7
2016
Useful R commands
Kruskal Wallis test: To test H0 : 1 = 2 = = g against H1 : at least one equality
does not hold, the R codes are
xv=as.matrix(x)
xv=as.vector(xv
The University of Sydney
STAT2012 Statistical Tests
Semester 2
Computer Practice Week 6
2016
Useful R commands
The R codes to calculate the values related to 2n , i.e. Pr(2n q) = p and Fm,n , i.e.
Pr(Fm,n q) = p are
dchisq(x,n),
df(x,m,n),
pchisq(q,n),
p
The University of Sydney
STAT2012 Statistical Tests
Semester 2
Computer Practice Week 5
2016
Useful R commands
The R command to perform a two samples t-test for the hypotheses: H0 : x = y
against H1 : x 6= y with the equality of variance assumption is
t.
STAT2012 Statistical Tests
7
L7 Nonparametric test
Nonparametric test- binomial test
What if the normality assumption of the previous tests are in doubt?
7.1
Binomial test for proportion in count data (P.361-366)
Example: (Flu vaccine) A flu vaccine is kn
STAT2012 Statistical Tests
sydney.edu.au/science/maths/stat2012
Semester 2, 2016
Solutions
Computer Lab Exercises 5
Last compiled: August 30, 2016
Exercises
These exercises will be utilising the same dataset survey from the Week 3-4
labs. Please refer to
STAT2012 Statistical Tests
sydney.edu.au/science/maths/stat2012
Semester 2, 2016
Solutions
Computer Lab Exercises 4
Last compiled: August 11, 2016
Exercises
These exercises will be utilising the same dataset survey from the Week 3 labs.
Please refer to th
a) Hypotheses
For treatment effects
H0: 1= 2= 3= 4= 5 vs H1: not all j equal
For blocks effects
H0: 1= 2= 3= 4= 5= 6= 7 vs H1: not all
i equal
One-way ANOVA
2.
a) hypotheses
For treatment effects
H0: 1= 2= 3 vs H1:
not all j equal
b) Two-way ANOVA test, t
THE UNIVERSITY OF SYDNEY
STAT2012 STATISTICAL TESTS
Semester 2
Solution to Tutorial Week 10
2016
Tutorial questions
1. We have n = 8,
8
X
8
X
xi = 429.5;
i=1
8
X
yi = 149.4;
i=1
x2i
= 26, 533.95;
i=1
8
X
yi2
= 5501.1;
8
X
i=1
xi yi = 11, 008.59.
i=1
149.4
STAT2012 Statistical Tests
28
L28 Chi-sq. test for category
Chi-square test for categorical data
Introduction
The models for different level of measurements of Y and X are summaried
below:
X
Y
Categorical Continuous
Categorical 2 GOF test
Continuous
ANOVA
STAT2012 Statistical Tests
23
L23 Regression analysis
Regression analysis: method of least squares
The main purpose of regression is to explore the dependence of one variable (Y ) on another variable (X), with both being continuous whereas
X is categorica
STAT2012 Statistical Tests
sydney.edu.au/science/maths/stat2012
Semester 2, 2016
Username:
Computer Lab Exercises 6
Last compiled: September 2, 2016
Exercises
These exercises will be utilising the same dataset survey from the Week 3-4
labs. Access the dat
STAT2012 Statistical Tests
1
L1 Introduction
Introduction
Motivation
You often come across data in various sizes and formats. It is important
that you can use some statistical models to analyze these data with the
aid of a statistical software in order to
STAT2012 Statistical Tests
13
13.1
L13 Chi-square & F-test
Chi-square- and F - tests
Review of 2-distribution (P.389-390)
Definitions: If X is a standard normal random variable, the distribution
of U = X 2 is called the chi-square distribution with degree
THE UNIVERSITY OF SYDNEY
STAT2012 STATISTICAL TESTS
Semester 2
Solution to Tutorial Week 7
2014
Tutorial questions
1. Let 1 , 2 and 3 denote the mean quantity of dissolved oxygen at the three locations
respectively. We have g = 3 groups, the total sample
THE UNIVERSITY OF SYDNEY
STAT2012 STATISTICAL TESTS
Semester 2
Solution to Tutorial Week 6
2015
Tutorial questions
1. (a) The Chi-square test for the variance of the closing prices of the first stock is
1. Hypothesis: H0 : 2 = 1 vs H1 : 2 > 1.
15 1.54
(n
STAT2012 Statistical Tests
19
19.1
L19 2-way ANOVA test I
Two-way ANOVA test
Two way layout: the Randomized Block design (P.629-649)
An experiment is designed to compare the effects of three different diets
(B1, B2, B3, say) to dogs weight. Assume that 12
The University of Sydney
STAT2012 Statistical Tests
Semester 2
Computer Practice Week 4
2016
Useful R commands
The R command to perform an one sample binomial test or sign test (p0 = 0.5) for the
hypotheses: H0 : p = p0 against H1 : p 6= p0 is
binom.test
The University of Sydney
STAT2012 Statistical Tests
Semester 2
R Practice Sheet
2016
Computer Exercise Week 1
You should read carefully all the instructions before you start !
In this course, you will learn to use the statistical package called R to perfo
The University of Sydney
STAT2012 Statistical Tests
Semester 2
Computer Practice Week 2
2016
Useful R codes
To perform an one sample t-test for the hypotheses: H0 : = 0 against H1 : 6= 0 ,
use
t.test(x,mu=mu0,alternative=".")
The arguments for alternativ
The University of Sydney
STAT2012 Statistical Tests
Semester 2
Computer Practice Week 3
2016
Useful R commands
The R command to perform an one sample t-test for the hypotheses: H0 : = 0 against
H1 : 6= 0 is
t.test(x,mu=mu0,alternative=".").
The alternati