Midterm II Statistics 449 (Winter 2016)
*FJ
Name: Q
I
Instructions: Show all work to receive credit. Partial credit may be given where work is
shown. Use the chi-square table where needed. Most calculators use LN for the natural log.
Total points: 7'5
1)

Homework 3 Solutions
1
1
0
Sample Logit
2
3
1a) The plot of the sample logits against x is given below followed by the R code. There
appears to be a linear trend.
24
26
28
30
Crab Width
y <- c(5,4,17,21,15,20,15,14)
ny <- c(9,10,11,18,7,4,3,0)
ymat <- cbi

Midterm I Statistics 449 (Winter 2016)
Name: l' e 3
Instructions: Show all work to receive credit. Partial credit may be given, but work must
be shown. Use the chi-square table where needed. Most calculators use LN for the natural
logarithm. For any stati

Homework 3 Solutions
1a) The R code and the plot of x against the sample logits are given below. There appears
to be a linear trend, so we will t the model that treats age as a continuous variable.
yes <- c(1,2,3,5,6,5,13,8)
no <- c(9,13,9,10,7,3,4,2)
yma

Homework 2 Solutions
1) The SAS code is shown below
1a) The odds ratio is 7.96 and the 95% CI is (7.21, 8.80). The odds of a fatal injury are
about 7.96 times greater for those who did not wear a seat belt compared to those who did
wear a seat belt. The r

Stats 449
10/5/16
Homework 2
1.
a) The odds ratio is 3.1158 and the 95% confidence interval is (1.8303, 5.3041). The
odds ratio is showing the ratio of death given the standard antibiotic drug against
alive given the standard antibiotic divided by the rat

Stats 449
11/16/16
Homework 5
1.
a)
b)
c)
2.
a) G2 = 4.6415 on 4 degrees of freedom
Parameter
Estimate
Alpha
-0.7597
Beta
5.6922
b)
Standard Error
0.1427
0.5366
c)
The estimates for standard error and the parameter are extremely similar to part a.
d)
The

Homework 4 Solutions
1a) The time series plots of and and the posterior density plot of are shown below.
The posterior mean of is 1.042 and the standard deviation is 0.6511. Answers may vary
slightly due to simulation.
1b) The correlation between the simu

Homework 5 / Practice Problem 2 Solutions
1.0
1a) Kaplan-Meier estimates are shown in the plot below. For the treatment group the estimated
probability a patient remains in remission for 15 weeks or greater is 0.69. For the placebo group
the estimated pro

Homework 2 Solutions
1) The SAS code is shown below
1a) The odds ratio is 3.71 and the 95% CI is (2.14, 6.45). The odds of death are about 3.71
times greater for those who took the standard treatment compared to those who took the
new drug. The result is

ECON251
FALL 2016
SAMPLE MIDTERM EXAM SOLUTIONS
Name and Student ID (as it appears in the Registrar):
Instructions
This exam consists of 9 pages in total. Please, check the number of pages of your exam
and contact the exam proctor if your exam has any mis

# Load the package and read the file
if(!require(XML)cfw_
install.packages("XML", dep=TRUE);
require(XML);
doc = xmlTreeParse('studentdata.xml');
root = xmlRoot(doc);
# Get the number of children of the root node
n = xmlSize(root);
print(n);
# Access the

Page 1
STAT 406: HW2
All computer code should be written using the language R. Type ALL your
code into one PLAIN Text format file. Plain text format is available by
default in R. Please do not use Microsoft Word .doc format or .rtf format of
.pdf format.

HomeworkSet7
Statistics408
Winter2015
1. Describe how the range, mean absolute deviation, the varianceandtheentropymeasures
arecalculatedasmeasuresofvariation.
Th
sh is
ar stu
ed d
vi y re
aC s
o
ou urc
rs e
eH w
er as
o.
co
m
Therangeofacollecteddatasetc

Page 1
STAT 406: HW5
All computer code should be written using the language R. Type ALL your
code into one PLAIN Text format file. Plain text format is available by
default in R. Please do not use Microsoft Word .doc format or .rtf format of
.pdf format.

Stats 449
11/9/16
Homework 4
1.
a) H0: 12 = 21
2
( 20390)2
2 ( n12 n21 )
2
Z=
Z 2=
Z =43.58
n 12 +n 21
203+ 90
We reject the null hypothesis because Z 2=43.58> X 12 ( 1 )=3.84 and we can
conclude that this data is not marginally homogeneous and therefore

Stats 449
10/11/16
Homework 3
1.5
1.0
0.5
slogit
0.0
0.5
a)
1.0
1.
30
40
50
60
x
Yes there does appear to be a linear trend between the sample logits and the x
values.
b)
G2 = 28.70152 0.52418 = 28.17734
df = 7 6 = 1
Yes, this is model is a good fit becau

1 On TOK
2 June TOK
3 4 TOK
4 , TOK
5 after TOK
6 the TOK
7 Chinese TOK
8 government TOK
9 began TOK
10 to TOK
11 massacre TOK
12 students TOK
13 in TOK
14 Beijing TOK
15 's TOK
16 Tiananmen TOK
17 Square TOK
18 , TOK
19 ABC TOK
20 dispatched TOK
21 a TOK

Homework 2 STATS 449 (Due 10-5)
Instructions: Answer the following questions using SAS or R as indicated. Perform
hand calculations as required. Show SAS and R output including plots as requested.
Late homework cannot be accepted. Neatness and presentatio

Assignment1
IntroductiontoNaturalLanguageProcessing
Fall2016
Totalpoints:90
Issued:09/20/2016Due:10/04/2016
All the code has to be your own (exceptions tothis rule are specifically noted below). The code
must run on the CAEN environment without additional

3.a. Yi = 1.36549 + 0.46740Xi
setwd(C:/Users/Mattk4/Documents)
Sparrows = read.csv(sparrows.csv)
y = sparrow$weight
x = sparrow$length
m1 <- lm(y ~ x, data = sparrow)
summary(m1)
#Call:
#lm(formula = y ~ x, data = sparrow)
#Residuals:
#
Min
1Q Median
3Q M

It is this adapting of absurd ` knots ' and patterns from old books to any
surface where a flower garden has to be made that leads to bad and frivolous
design - wrong in plan and hopeless for the life of plants .
Many small investors are facing a double w

The mean is .397875 and the standard deviation is 0.05013301. The results support the CLT because the
histogram below appears normal and sample mean is close to the theoretical value 0.4 and 0.049 is close
to the theoretical value.
0.24/96
= 0.5.
X <- rb

Sarah van der Walde
Stats 449-HW2
1. SAS OUTPUT
2. See written paper
3. R output and Code
FOR A
> hist(theta,col="lightblue",breaks=15,main=")
> simdat <- rmultinom(1000,size=102, prob=c(40,15,20,27)/102)
> thfun <- function(thta) cfw_ (thta[1]*thta[4])/(

Sarah van der Walde
Stats 449-HW3
10/9/16
1.
a.
b. G2= residual deviance = 0.52418 on 6 degrees of freedom.
This model appears to be a good fit because from the scatterplot we can assume
a linear trend between X and the sample logits. Because 0.52418 < 12

Midterm I Statistics 449 (Fall 2016)
Name:
Instructions: Show all work to receive credit. Partial credit may be given, but work must
be shown. Use the chi-square table where needed. Most calculators use LN for the natural
logarithm. For any statistical te