SlideShare a Scribd company logo
For any help regarding Statistics Assignment Help visit :
https://www.statisticsassignmenthelp.com/,
Email - support@statisticsassignmenthelp.com
or call us at - +1 678 648 4277
statisticsassignmenthelp.com
Statistics for Applications
Problems from John A. Rice, Third Edition. [Chapter.Section.Problem]
1. 12.5.1
Solution: See R script/html P roblem 12 5 1.r/html
2. 12.5.6
Prove this version of the Bonferroni inequality:
n
i=1 i
P (∩ A ) ≥ 1 − n
P (A c)
i=1 i
∗
n
i=1
Let A = ∩ Ai. Then
Σ
c ∪
A = n Ac
∗ k=1 i
n
c n c
So P (A ) = P (∪ A )
c
Σ
∗ k=1 i k=1 i
≤ P (A c)
Because P (A ) = 1 − P (A ), it follows that
∗ ∗
∗
P (A ) ≥ 1 − n
P (A c)
k=1 i
In the context of simulataneous confidence intervals
Σ
Ai is the the event that the ith confidence interval contains the associated parameter
n
i=1
∩ Ai is the the event that all confidence intervals contains
the associated parameters simultaneously.
3. 12.5.17. Find the mle’s of the parameters αi, βj, δij, and µ of the model for the two-way layout.
The model for the two-way layout is given by:
Yijk = µ + αi + βj + δij + Eijk
where Σ
Σ
I
i=1
J
j =1
αi = 0
βj = 0
I J
ij
δ =
Σ Σ
i=1 j =1
As noted in Rice (p. 493) the log likelihood is
δij = 0
statisticsassignmenthelp.com
I J K 2 1 I
l = − log(2πσ ) −
2 2σ2
Σ Σ Σ
J K
i=1 j =1 k=1
(Yij k − µ − αi − βj − δij )2
Solving the following equations:
∂l = 0 =⇒ µ̂ = Y···
= 0 =⇒ α̂i = Yi·· − µ̂
ˆ
i ·j ·
= 0 =⇒ β = Y − µ̂
∂µi
∂l
∂αi
∂l
∂βi
∂l
∂δij
= 0 =⇒ δ̂ij = Yij · − µ̂ − α̂i − β̂j
These terms yield the answer formulas of the problem.
4. 13.8.1. See R script html P roblem 13 8 1.html
5. 13.8.25. See R script html P roblem 13 8 25.html
statisticsassignmenthelp.com
Problem_12_5_1.r
# Problem_12_5_1.r
# Simulate 7 batches of ten normally distributed random numbers
# with mean 4 and variance .0037
nbatches=7
sampsize=10
mu=4.
sigmasq=.0037
set.seed(1)
# Set seed to be able to replicate simulations
par(mfcol=c(3,2)) for (i in c(1:6)){ batches<-matrix(rnorm(nbatches*sampsize,mean=mu,
sd=sqrt(sigmasq)), nrow=sampsize, ncol=nbatches)
boxplot(batches, xlab=paste("Batch for Batch Set ", i,sep="")) }
statisticsassignmenthelp.com
# In this set of simulations, there are pairs of labs that appear quite different
# in mean level: Batch Set 3, batches 1 and 4, Batch set 2, batches 2 and 5
# in dispersion: Batch Set 1, batches 5 and 7, Batch Set 6, batches 3 and 4. #
# Note that with the smaple sample size (10), the variation will be moderate.
# If we change the sampsize to 250, there should be little differences in mean
# and dispersion due to the larger sample sizes. sampsize=250 set.seed(1)
# Set seed to be able to replicate simulations par(mfcol=c(3,2)) for (i in c(1:6)){ batches<-
matrix(rnorm(nbatches*sampsize,mean=mu, sd=sqrt(sigmasq)), nrow=sampsize, ncol=nbatches)
boxplot(batches, xlab=paste("Batch for Batch Set ", i,sep="")) }
# In these plots, the mean level is quite constant as is the # dispersion as measured by the
inter-quartile range.
statisticsassignmenthelp.com
Problem_13_8_1.r
# Problem_12_5_1.r
# Adult-onset diabites table: frequency data of a particular allele in a sample of
# such diabetics and a sample of nondiabetics tableA=data.frame( Diabetic=rbind(Bborbb=12., BB=39),
Normal=rbind(Bborbb=4., BB=49))
# # 2. Conduct ChiSquare Test of Independence ----
# Custom function implementing chisqtest fcn.chisqtest<-function(tableA){ cat("n Two-Way Table: n")
print(tableA) n.total=sum(as.vector(tableA)) cat("n Total Counts in Table: ", n.total,"n")
# Compute marginal probabilities of
# TattooStatus and of HepCStatus probs.TattooStatus=rowSums(tableA)/n.total
probs.HepCStatus=colSums(tableA)/n.total cat("n MLEs of row level probabilitiesn") print(probs.TattooStatus)
cat("n MLEs of column level probabilitiesn") print(probs.HepCStatus) # Compute table of fitted cell probabilities
and # expected counts assuming independence of two factors
tableA.fittedprobs=as.matrix(probs.TattooStatus)%*% t( as.matrix(probs.HepCStatus) ) cat("n Fitted cell
probabilities assuming independencen") print(tableA.fittedprobs) tableA.expected=n.total* tableA.fittedprobs
cat("n Expected Counts assuming independence n") print(tableA.expected)
# Compute standardized residuals fitted table tableA.chisqresiduals=((tableA -
tableA.expected))/sqrt(tableA.expected) cat("n Table of Chi-Square Residuals by celln")
print(tableA.chisqresiduals)
# Compute table of chi-square test statistic contributions tableA.chisqterms=((tableA -
tableA.expected)^2)/tableA.expected cat("n Table of Chi-Square statistic terms by celln")
print(tableA.chisqterms) tableA.chisqStatistic=sum(as.vector(tableA.chisqterms)) cat("n Chi-Square Statistic:
",tableA.chisqStatistic,"n") df.tableA=(nrow(tableA)-1)*(ncol(tableA)-1) cat("n degrees of freedom: ", df.tableA,
"n") tableA.chisqStatistic.pvalue=1- pchisq(tableA.chisqStatistic, df=df.tableA) cat("n P-Value : ",
tableA.chisqStatistic.pvalue, "nn") } fcn.chisqtest(tableA)
statisticsassignmenthelp.com
## ## Two-Way Table:
## Diabetic Normal
## Bborbb 12 4
## BB 39 49
## Total Counts in Table: 104
## MLEs of row level probabilities
## Bborbb BB ## 0.1538462 0.8461538
## ## MLEs of column level probabilities
## Diabetic Normal
## 0.4903846 0.5096154
## ## Fitted cell probabilities assuming independence
## Diabetic Normal
## Bborbb 0.07544379 0.07840237
## BB 0.41494083 0.43121302
## ## Expected Counts assuming independence
## Diabetic Normal
## Bborbb 7.846154 8.153846
## BB 43.153846 44.846154
## ## Table of Chi-Square Residuals by cell
## Diabetic Normal
## Bborbb 1.4829346 -1.454686
## BB -0.6323254 0.620280
## Table of Chi-Square statistic terms by cell
## Diabetic Normal
## Bborbb 2.1990950 2.1161103
## BB 0.3998355 0.3847473
## Chi-Square Statistic: 5.099788
## degrees of freedom: 1
## P-Value : 0.02392877
# The p-Value is 0.0239, which is significant at nominal alpha/size level of 0.05.
# From the output, we see that the expected counts assuming indepndence are
# all greater than 5, so we are not overly concerned with
# the chi-square distribution approximation to the chi-square statistic
# under the null hypothesis of independence (of row and column factors)
statisticsassignmenthelp.com
Problem_13_8_25.r
#Problem_13_8_25.r # # Custom function implementing chisqtest fcn.chisqtest<-function(tableA){ cat("n Two-
Way Table: n") print(tableA) n.total=sum(as.vector(tableA)) cat("n Total Counts in Table: ", n.total,"n")
# Compute marginal probabilities of
# TattooStatus and of HepCStatus probs.TattooStatus=rowSums(tableA)/n.total
probs.HepCStatus=colSums(tableA)/n.total cat("n MLEs of row level probabilitiesn") print(probs.TattooStatus)
cat("n MLEs of column level probabilitiesn") print(probs.HepCStatus)
# Compute table of fitted cell probabilities and # expected counts assuming independence of two factors
tableA.fittedprobs=as.matrix(probs.TattooStatus)%*% t( as.matrix(probs.HepCStatus) ) cat("n Fitted cell
probabilities assuming independencen") print(tableA.fittedprobs) tableA.expected=n.total* tableA.fittedprobs cat("n
Expected Counts assuming independence n") print(tableA.expected)
# Compute standardized residuals fitted table tableA.chisqresiduals=((tableA -
tableA.expected))/sqrt(tableA.expected) cat("n Table of Chi-Square Residuals by celln") print(tableA.chisqresiduals)
# Compute table of chi-square test statistic contributions tableA.chisqterms=((tableA -
tableA.expected)^2)/tableA.expected cat("n Table of Chi-Square statistic terms by celln") print(tableA.chisqterms)
tableA.chisqStatistic=sum(as.vector(tableA.chisqterms)) cat("n Chi-Square Statistic: ",tableA.chisqStatistic,"n")
df.tableA=(nrow(tableA)-1)*(ncol(tableA)-1) cat("n degrees of freedom: ", df.tableA, "n")
tableA.chisqStatistic.pvalue=1- pchisq(tableA.chisqStatistic, df=df.tableA) cat("n P-Value : ",
tableA.chisqStatistic.pvalue, "nn") }
############### # 1. Problem 25: Physicians Health Study Tattoo/HepC Two-Way Table ----
tableD=data.frame( Asprin=rbind( MCIFatal=10, MCINonFatal=129, StrokeFatal=9, StrokeNonFatal=110),
Placebo=rbind( MCIFatal=26, MCINonFatal=213, StrokeFatal=6, StrokeNonFatal=92) )
tableD.colSums=colSums(tableD) tableD.1<-rbind(tableD, None=((tableD.colSums*-1) +c(11037, 11034))) # (a). Test 1
# Chisquare test of homogenity -- rates are same # for Aspirin population and Placebo population
fcn.chisqtest(tableD.1)
statisticsassignmenthelp.com
## ## Two-Way Table:
## Asprin Placebo
## MCIFatal 10 26
## MCINonFatal 129 213
## StrokeFatal 9 6
## StrokeNonFatal 110 92
## None 10779 10697
## ## Total Counts in Table: 22071
## ## MLEs of row level probabilities
## MCIFatal MCINonFatal StrokeFatal StrokeNonFatal None
## 0.0016310996 0.0154954465 0.0006796248 0.0091522813 0.9730415477
## ## MLEs of column level probabilities
## Asprin Placebo
## 0.500068 0.499932
## Fitted cell probabilities assuming independence
## Asprin Placebo ## MCIFatal 0.0008156607 0.0008154390
## MCINonFatal 0.0077487764 0.0077466701
## StrokeFatal 0.0003398586 0.0003397662
## StrokeNonFatal 0.0045767626 0.0045755186
## None 0.4865869042 0.4864546435
## ## Expected Counts assuming independence
## Asprin Placebo ## MCIFatal 18.002447 17.997553
## MCINonFatal 171.023243 170.976757
## StrokeFatal 7.501019 7.498981
## StrokeNonFatal 101.013728 100.986272
## None 10739.459562 10736.540438
## ## Table of Chi-Square Residuals by cell
## Asprin Placebo
## MCIFatal -1.8860666 1.8863230
## MCINonFatal -3.2133793 3.2138162
## StrokeFatal 0.5473131 -0.5473875
## StrokeNonFatal 0.8941067 -0.8942282
statisticsassignmenthelp.com
## None 0.3815489 -0.3816008
## ## Table of Chi-Square statistic terms by cell
## Asprin Placebo
## MCIFatal 3.5572472 3.5582143
## MCINonFatal 10.3258068 10.3286142
## StrokeFatal 0.2995516 0.2996331
## StrokeNonFatal 0.7994268 0.7996441
## None 0.1455796 0.1456192
## ## Chi-Square Statistic: 30.25934
## ## degrees of freedom: 4
## ## P-Value : 4.33405e-06
# Results significant, with MCIFatal and MCINonFatal significantly
# lower for Aspirin versus Placebo (see the chisq residuals)
# (a). Test 2
# Analyse total incidence of myocardial infarction
tableD.2=rbind( MCITotal=colSums(tableD.1[1:2,]),
Other=colSums(tableD.1[3:5,])) print(tableD.2)
## Asprin Placebo
## MCITotal 139 239
## Other 10898 10795fcn.chisqtest(tableD.2)
statisticsassignmenthelp.com
## ## Two-Way Table:
## Asprin Placebo
## MCITotal 139 239
## Other 10898 10795
## Total Counts in Table: 22071
## ## MLEs of row level probabilities
## MCITotal Other
## 0.01712655 0.98287345
## ## MLEs of column level probabilities
## Asprin Placebo ## 0.500068 0.499932
## Fitted cell probabilities assuming independence
## Asprin Placebo
## MCITotal 0.008564437 0.008562109
## Other 0.491503525 0.491369928
## Expected Counts assuming independence
## Asprin Placebo
## MCITotal 189.0257 188.9743
## Other 10847.9743 10845.0257
## Table of Chi-Square Residuals by cell
## Asprin Placebo
## MCITotal -3.6385862 3.6390808
## Other 0.4803068 -0.4803721
## ## Table of Chi-Square statistic terms by cell
## Asprin Placebo
## MCITotal 13.2393097 13.2429093
## Other 0.2306947 0.2307574
## ## Chi-Square Statistic: 26.94367
## ## degrees of freedom: 1
## ## P-Value : 2.09472e-07
# Total incidence of MCI is significantly reduced by aspirin
# (a). Test 3
# Analyse incidence of fatal and nonfatal tableD.3=rbind(
FatalNonFatal=colSums(tableD.1[c(1,2,3,4),]), Other=colSums(tableD.1[c(5),])) fcn.chisqtest(tableD.3)
statisticsassignmenthelp.com
## ## Two-Way Table:
## Asprin Placebo
## FatalNonFatal 258 337
## Other 10779 10697
## ## Total Counts in Table: 22071
## ## MLEs of row level probabilities
## FatalNonFatal Other
## 0.02695845 0.97304155
## ## MLEs of column level probabilities
## Asprin Placebo ## 0.500068 0.499932
## ## Fitted cell probabilities assuming independence
## Asprin Placebo
## FatalNonFatal 0.01348106 0.01347739
## Other 0.48658690 0.48645464
## ## Expected Counts assuming independence
## Asprin Placebo
## FatalNonFatal 297.5404 297.4596
## Other 10739.4596 10736.5404
## ## Table of Chi-Square Residuals by cell
## Asprin Placebo
## FatalNonFatal -2.2922843 2.2925959
## Other 0.3815489 -0.3816008
## ## Table of Chi-Square statistic terms by cell
## Asprin Placebo ## FatalNonFatal 5.2545672 5.2559958
## Other 0.1455796 0.1456192 ## ## Chi-Square Statistic: 10.80176
## ## degrees of freedom: 1
## ## P-Value : 0.001014035
# Incidence of cardiovascular events is lower under Aspirin vs Placebo
# but the significance is lower (though still significant relative to nominal levels)
# (a). Test 4
# Among those having MCI, evaluate whether
# fatality rate depends on Aspirin versus Placebo fcn.chisqtest(tableD.1[1:2,])
statisticsassignmenthelp.com
## ## Two-Way Table:
## Asprin Placebo
## MCIFatal 10 26
## MCINonFatal 129 213
## ## Total Counts in Table: 378
## ## MLEs of row level probabilities
## MCIFatal MCINonFatal
## 0.0952381 0.9047619
## ## MLEs of column level probabilities
## Asprin Placebo
## 0.3677249 0.6322751
## ## Fitted cell probabilities assuming independence
## Asprin Placebo
## MCIFatal 0.03502142 0.06021668
## MCINonFatal 0.33270345 0.57205845
## ## Expected Counts assuming independence
## Asprin Placebo
## MCIFatal 13.2381 22.7619
## MCINonFatal 125.7619 216.2381
## ## Table of Chi-Square Residuals by cell
## Asprin Placebo
## MCIFatal -0.8899731 0.6787117
## MCINonFatal 0.2887454 -0.2202031
## ## Table of Chi-Square statistic terms by cell
## Asprin Placebo
## MCIFatal 0.7920521 0.46064953
## MCINonFatal 0.0833739 0.04848942
## ## Chi-Square Statistic: 1.384565
## ## degrees of freedom: 1
## ## P-Value : 0.2393251
statisticsassignmenthelp.com
# Not significant
# (a). Test 5 Incidence of strokes tableD.4=rbind( Strokes=colSums(tableD.1[c(3,4),]), Other=colSums(tableD.1[c(1,2,5),]))
fcn.chisqtest(tableD.4)
## ## Two-Way Table:
## Asprin Placebo
## Strokes 119 98
## Other 10918 10936
## ## Total Counts in Table: 22071
## ## MLEs of row level probabilities
## Strokes Other
## 0.009831906 0.990168094
## ## MLEs of column level probabilities
## Asprin Placebo
## 0.500068 0.499932
## ## Fitted cell probabilities assuming independence
## Asprin Placebo
## Strokes 0.004916621 0.004915285
## Other 0.495151341 0.495016753
## ## Expected Counts assuming independence
## Asprin Placebo
## Strokes 108.5147 108.4853
## Other 10928.4853 10925.5147
## ## Table of Chi-Square Residuals by cell
## Asprin Placebo
## Strokes 1.0065480 -1.0066848
## Other -0.1002995 0.1003132
## ## Table of Chi-Square statistic terms by cell
## Asprin Placebo
## Strokes 1.013139 1.01341436
## Other 0.010060 0.01006273
## ## Chi-Square Statistic: 2.046676
## ## degrees of freedom: 1
## ## P-Value : 0.1525389
statisticsassignmenthelp.com
# Not significantly different
# (b). Table of cariovascular mortality tableE=data.frame( Asprin=rbind( AcuteMCI=10, OtherIHD=24,
SuddenDeath=22, Stroke=10,
OtherCard=15),
Placebo=rbind( AcuteMCI=28,
OtherIHD=25, SuddenDeath=12,
Stroke=7, OtherCard=11))
tableE.colSums=colSums(tableE)
tableE.1<-rbind(tableE, None=((tableE.colSums*-1) +c(11037, 11034)) ) tableE.1
## Asprin Placebo
## AcuteMCI 10 28
## OtherIHD 24 25
## SuddenDeath 22 12
## Stroke 10 7
## OtherCard 15 11
## None 10956 10951fcn.chisqtest(tableE.1)
statisticsassignmenthelp.com
## ## Two-Way Table:
## Asprin Placebo
## AcuteMCI 10 28
## OtherIHD 24 25
## SuddenDeath 22 12
## Stroke 10 7
## OtherCard 15 11
## None 10956 10951
## ## Total Counts in Table: 22071
## ## MLEs of row level probabilities
## AcuteMCI OtherIHD SuddenDeath Stroke OtherCard
## 0.0017217163 0.0022201078 0.0015404830 0.0007702415 0.0011780164
## None
## 0.9925694350
## ## MLEs of column level probabilities
## Asprin Placebo ## 0.500068 0.499932
## ## Fitted cell probabilities assuming independence
## Asprin Placebo
## AcuteMCI 0.0008609752 0.0008607411
## OtherIHD 0.0011102048 0.0011099030
## SuddenDeath 0.0007703462 0.0007701368
## Stroke 0.0003851731 0.0003850684
## OtherCard 0.0005890883 0.0005889281
## None 0.4963521750 0.4962172600
## ## Expected Counts assuming independence
## Asprin Placebo
## AcuteMCI 19.002583 18.997417
## OtherIHD 24.503330 24.496670
## SuddenDeath 17.002311 16.997689
## Stroke 8.501155 8.498845
## OtherCard 13.001767 12.998233
statisticsassignmenthelp.com
## None 10954.988854 10952.011146
## ## Table of Chi-Square Residuals by cell
## Asprin Placebo
## AcuteMCI -2.065193737 2.065474468
## OtherIHD -0.101681138 0.101694960
## SuddenDeath 1.212035322 -1.212200079
## Stroke 0.514064534 -0.514134412
## OtherCard 0.554172450 -0.554247781
## None 0.009660683 -0.009661996
## ## Table of Chi-Square statistic terms by cell
## Asprin Placebo
## AcuteMCI 4.2650251718 4.266185e+00
## OtherIHD 0.0103390539 1.034186e-02
## SuddenDeath 1.4690296219 1.469429e+00
## Stroke 0.2642623446 2.643342e-01
## OtherCard 0.3071071045 3.071906e-01
## None 0.0000933288 9.335417e-05
## ## Chi-Square Statistic: 12.63343
## ## degrees of freedom: 5
## ## P-Value : 0.0270671
statisticsassignmenthelp.com
# Mortality due to AcuteMCI is significantly reduced by Aspirin
# The P-value is 0.027
# (b). Test 2
# Evaluation of total cariovascular mortality: tableE.2<-rbind(TotalCard=colSums(tableE.1[c(1:5),]), None=tableE.1[6,])
fcn.chisqtest(tableE.2)
## ## Two-Way Table:
## Asprin Placebo
## TotalCard 81 83
## None 10956 10951
## ## Total Counts in Table: 22071
## ## MLEs of row level probabilities
## TotalCard None
## 0.007430565 0.992569435
## ## MLEs of column level probabilities
## Asprin Placebo
## 0.500068 0.499932
## ## Fitted cell probabilities assuming independence
## Asprin Placebo
## TotalCard 0.003715787 0.003714777
## None 0.496352175 0.496217260
## ## Expected Counts assuming independence
## Asprin Placebo
## TotalCard 82.01115 81.98885
## None 10954.98885 10952.01115
## ## Table of Chi-Square Residuals by cell
## Asprin Placebo
## TotalCard -0.111654791 0.111669969
## None 0.009660683 -0.009661996
## ## Table of Chi-Square statistic terms by cell
## Asprin Placebo
## TotalCard 0.0124667923 1.247018e-02
## None 0.0000933288 9.335417e-05
## ## Chi-Square Statistic: 0.02512366
## ## degrees of freedom: 1
## ## P-Value : 0.8740593
# Not significant
statisticsassignmenthelp.com

More Related Content

PPTX
statistics assignment help
PPTX
statistics assignment help
PPTX
Probability Assignment Help
PDF
Business statistics homework help
PPTX
Statistical Assignment Help
PPTX
Stochastic Processes Homework Help
PPTX
Statistics Assignment Help
PDF
Curvefitting
statistics assignment help
statistics assignment help
Probability Assignment Help
Business statistics homework help
Statistical Assignment Help
Stochastic Processes Homework Help
Statistics Assignment Help
Curvefitting

What's hot (20)

PPTX
Polynomials and Curve Fitting in MATLAB
PPTX
Statistics Assignment Help
PPTX
PDF
Linear Regression Ordinary Least Squares Distributed Calculation Example
PPTX
probability assignment help (2)
PPTX
Probability Assignment Help
PPTX
PPT
numerical methods
PDF
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
PPTX
Data Analysis Homework Help
PPTX
Non Linear Equation
PPTX
ML - Multiple Linear Regression
DOC
Lesson 8
DOCX
Chapter 5
PDF
Pattern Discovery - part I
PPTX
Presentation on application of numerical method in our life
PDF
2. polynomial interpolation
PPTX
Numerical method-Picards,Taylor and Curve Fitting.
PPT
Mws gen nle_ppt_bisection
PPTX
Polynomials and Curve Fitting in MATLAB
Statistics Assignment Help
Linear Regression Ordinary Least Squares Distributed Calculation Example
probability assignment help (2)
Probability Assignment Help
numerical methods
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Data Analysis Homework Help
Non Linear Equation
ML - Multiple Linear Regression
Lesson 8
Chapter 5
Pattern Discovery - part I
Presentation on application of numerical method in our life
2. polynomial interpolation
Numerical method-Picards,Taylor and Curve Fitting.
Mws gen nle_ppt_bisection
Ad

Similar to Statistics Assignment Help (20)

DOCX
7292015Intro to Biostatistics Homework #8Use R to calculate .docx
DOCX
1CONCORDIA UNIVERSITY Department of Economics .docx
PDF
How to manage your Experimental Protocol with Basic Statistics
DOCX
This quiz consists of 20 questions most appear to be similar but now.docx
PPT
Chapter 4(2) Hypothesisi Testing
PDF
Workshop 4
PDF
Reading Data into R
PPT
Chapter 4(2) Hypothesisi Testing
PPT
Chapter 4(2) Hypothesisi Testing
PPTX
Chisquare
DOCX
1. The standard deviation of the diameter at breast height, or DBH.docx
DOCX
Please put answers below the boxes1) A politician claims that .docx
PPTX
Chi square(hospital admin)
PPT
Chi-square, Yates, Fisher & McNemar
DOCX
1. True or False. Justify for full credit. .docx
PDF
Chisquare Test of Association.pdf in biostatistics
PPTX
Data Analysis Assignment Help
DOCX
Question 1 (25 points)Question 1 optionsEnter the answer to.docx
PPTX
Statistics Coursework Assignment Help
DOCX
Introductory Statistics Laboratory for Excel .docx
7292015Intro to Biostatistics Homework #8Use R to calculate .docx
1CONCORDIA UNIVERSITY Department of Economics .docx
How to manage your Experimental Protocol with Basic Statistics
This quiz consists of 20 questions most appear to be similar but now.docx
Chapter 4(2) Hypothesisi Testing
Workshop 4
Reading Data into R
Chapter 4(2) Hypothesisi Testing
Chapter 4(2) Hypothesisi Testing
Chisquare
1. The standard deviation of the diameter at breast height, or DBH.docx
Please put answers below the boxes1) A politician claims that .docx
Chi square(hospital admin)
Chi-square, Yates, Fisher & McNemar
1. True or False. Justify for full credit. .docx
Chisquare Test of Association.pdf in biostatistics
Data Analysis Assignment Help
Question 1 (25 points)Question 1 optionsEnter the answer to.docx
Statistics Coursework Assignment Help
Introductory Statistics Laboratory for Excel .docx
Ad

More from Statistics Assignment Help (20)

PPTX
Calculating Expected Values and Variances in Statistics
PPTX
Bayesian Inference and Maximum Likelihood
PPTX
Method of Moments and Maximum Likelihood Estimation
PPTX
Statistical Analysis of Corneal Thickness in Glaucoma Patients
PPTX
Get Accurate and Reliable Statistics Assignment Help - Boost Your Grades!
PPTX
Statistics Assignment Help
PPTX
Pay For Statistics Assignment
PPTX
Probability Assignment Help
PPTX
Data Analysis Assignment Help
PPTX
R Programming Assignment Help
PPTX
Hypothesis Assignment Help
PPTX
The Data of an Observational Study Designed to Compare the Effectiveness of a...
PPTX
T- Test and ANOVA using SPSS Assignment Help
PPT
Linear Regression Analysis assignment help.ppt
PPTX
Stata Assignment Help
PPTX
MyStataLab Assignment Help
PPTX
Probability and Statistics Assignment Help
PPTX
Mathematical Statistics Assignment Help
PPTX
Statistics Assignment Help
PPTX
Advanced Statistics Assignment help
Calculating Expected Values and Variances in Statistics
Bayesian Inference and Maximum Likelihood
Method of Moments and Maximum Likelihood Estimation
Statistical Analysis of Corneal Thickness in Glaucoma Patients
Get Accurate and Reliable Statistics Assignment Help - Boost Your Grades!
Statistics Assignment Help
Pay For Statistics Assignment
Probability Assignment Help
Data Analysis Assignment Help
R Programming Assignment Help
Hypothesis Assignment Help
The Data of an Observational Study Designed to Compare the Effectiveness of a...
T- Test and ANOVA using SPSS Assignment Help
Linear Regression Analysis assignment help.ppt
Stata Assignment Help
MyStataLab Assignment Help
Probability and Statistics Assignment Help
Mathematical Statistics Assignment Help
Statistics Assignment Help
Advanced Statistics Assignment help

Recently uploaded (20)

PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Pre independence Education in Inndia.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
01-Introduction-to-Information-Management.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Classroom Observation Tools for Teachers
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Basic Mud Logging Guide for educational purpose
PDF
RMMM.pdf make it easy to upload and study
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
VCE English Exam - Section C Student Revision Booklet
Pre independence Education in Inndia.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
01-Introduction-to-Information-Management.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Final Presentation General Medicine 03-08-2024.pptx
Classroom Observation Tools for Teachers
Renaissance Architecture: A Journey from Faith to Humanism
Supply Chain Operations Speaking Notes -ICLT Program
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Cell Structure & Organelles in detailed.
2.FourierTransform-ShortQuestionswithAnswers.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Basic Mud Logging Guide for educational purpose
RMMM.pdf make it easy to upload and study

Statistics Assignment Help

  • 1. For any help regarding Statistics Assignment Help visit : https://www.statisticsassignmenthelp.com/, Email - support@statisticsassignmenthelp.com or call us at - +1 678 648 4277 statisticsassignmenthelp.com
  • 2. Statistics for Applications Problems from John A. Rice, Third Edition. [Chapter.Section.Problem] 1. 12.5.1 Solution: See R script/html P roblem 12 5 1.r/html 2. 12.5.6 Prove this version of the Bonferroni inequality: n i=1 i P (∩ A ) ≥ 1 − n P (A c) i=1 i ∗ n i=1 Let A = ∩ Ai. Then Σ c ∪ A = n Ac ∗ k=1 i n c n c So P (A ) = P (∪ A ) c Σ ∗ k=1 i k=1 i ≤ P (A c) Because P (A ) = 1 − P (A ), it follows that ∗ ∗ ∗ P (A ) ≥ 1 − n P (A c) k=1 i In the context of simulataneous confidence intervals Σ Ai is the the event that the ith confidence interval contains the associated parameter n i=1 ∩ Ai is the the event that all confidence intervals contains the associated parameters simultaneously. 3. 12.5.17. Find the mle’s of the parameters αi, βj, δij, and µ of the model for the two-way layout. The model for the two-way layout is given by: Yijk = µ + αi + βj + δij + Eijk where Σ Σ I i=1 J j =1 αi = 0 βj = 0 I J ij δ = Σ Σ i=1 j =1 As noted in Rice (p. 493) the log likelihood is δij = 0 statisticsassignmenthelp.com
  • 3. I J K 2 1 I l = − log(2πσ ) − 2 2σ2 Σ Σ Σ J K i=1 j =1 k=1 (Yij k − µ − αi − βj − δij )2 Solving the following equations: ∂l = 0 =⇒ µ̂ = Y··· = 0 =⇒ α̂i = Yi·· − µ̂ ˆ i ·j · = 0 =⇒ β = Y − µ̂ ∂µi ∂l ∂αi ∂l ∂βi ∂l ∂δij = 0 =⇒ δ̂ij = Yij · − µ̂ − α̂i − β̂j These terms yield the answer formulas of the problem. 4. 13.8.1. See R script html P roblem 13 8 1.html 5. 13.8.25. See R script html P roblem 13 8 25.html statisticsassignmenthelp.com
  • 4. Problem_12_5_1.r # Problem_12_5_1.r # Simulate 7 batches of ten normally distributed random numbers # with mean 4 and variance .0037 nbatches=7 sampsize=10 mu=4. sigmasq=.0037 set.seed(1) # Set seed to be able to replicate simulations par(mfcol=c(3,2)) for (i in c(1:6)){ batches<-matrix(rnorm(nbatches*sampsize,mean=mu, sd=sqrt(sigmasq)), nrow=sampsize, ncol=nbatches) boxplot(batches, xlab=paste("Batch for Batch Set ", i,sep="")) } statisticsassignmenthelp.com
  • 5. # In this set of simulations, there are pairs of labs that appear quite different # in mean level: Batch Set 3, batches 1 and 4, Batch set 2, batches 2 and 5 # in dispersion: Batch Set 1, batches 5 and 7, Batch Set 6, batches 3 and 4. # # Note that with the smaple sample size (10), the variation will be moderate. # If we change the sampsize to 250, there should be little differences in mean # and dispersion due to the larger sample sizes. sampsize=250 set.seed(1) # Set seed to be able to replicate simulations par(mfcol=c(3,2)) for (i in c(1:6)){ batches<- matrix(rnorm(nbatches*sampsize,mean=mu, sd=sqrt(sigmasq)), nrow=sampsize, ncol=nbatches) boxplot(batches, xlab=paste("Batch for Batch Set ", i,sep="")) } # In these plots, the mean level is quite constant as is the # dispersion as measured by the inter-quartile range. statisticsassignmenthelp.com
  • 6. Problem_13_8_1.r # Problem_12_5_1.r # Adult-onset diabites table: frequency data of a particular allele in a sample of # such diabetics and a sample of nondiabetics tableA=data.frame( Diabetic=rbind(Bborbb=12., BB=39), Normal=rbind(Bborbb=4., BB=49)) # # 2. Conduct ChiSquare Test of Independence ---- # Custom function implementing chisqtest fcn.chisqtest<-function(tableA){ cat("n Two-Way Table: n") print(tableA) n.total=sum(as.vector(tableA)) cat("n Total Counts in Table: ", n.total,"n") # Compute marginal probabilities of # TattooStatus and of HepCStatus probs.TattooStatus=rowSums(tableA)/n.total probs.HepCStatus=colSums(tableA)/n.total cat("n MLEs of row level probabilitiesn") print(probs.TattooStatus) cat("n MLEs of column level probabilitiesn") print(probs.HepCStatus) # Compute table of fitted cell probabilities and # expected counts assuming independence of two factors tableA.fittedprobs=as.matrix(probs.TattooStatus)%*% t( as.matrix(probs.HepCStatus) ) cat("n Fitted cell probabilities assuming independencen") print(tableA.fittedprobs) tableA.expected=n.total* tableA.fittedprobs cat("n Expected Counts assuming independence n") print(tableA.expected) # Compute standardized residuals fitted table tableA.chisqresiduals=((tableA - tableA.expected))/sqrt(tableA.expected) cat("n Table of Chi-Square Residuals by celln") print(tableA.chisqresiduals) # Compute table of chi-square test statistic contributions tableA.chisqterms=((tableA - tableA.expected)^2)/tableA.expected cat("n Table of Chi-Square statistic terms by celln") print(tableA.chisqterms) tableA.chisqStatistic=sum(as.vector(tableA.chisqterms)) cat("n Chi-Square Statistic: ",tableA.chisqStatistic,"n") df.tableA=(nrow(tableA)-1)*(ncol(tableA)-1) cat("n degrees of freedom: ", df.tableA, "n") tableA.chisqStatistic.pvalue=1- pchisq(tableA.chisqStatistic, df=df.tableA) cat("n P-Value : ", tableA.chisqStatistic.pvalue, "nn") } fcn.chisqtest(tableA) statisticsassignmenthelp.com
  • 7. ## ## Two-Way Table: ## Diabetic Normal ## Bborbb 12 4 ## BB 39 49 ## Total Counts in Table: 104 ## MLEs of row level probabilities ## Bborbb BB ## 0.1538462 0.8461538 ## ## MLEs of column level probabilities ## Diabetic Normal ## 0.4903846 0.5096154 ## ## Fitted cell probabilities assuming independence ## Diabetic Normal ## Bborbb 0.07544379 0.07840237 ## BB 0.41494083 0.43121302 ## ## Expected Counts assuming independence ## Diabetic Normal ## Bborbb 7.846154 8.153846 ## BB 43.153846 44.846154 ## ## Table of Chi-Square Residuals by cell ## Diabetic Normal ## Bborbb 1.4829346 -1.454686 ## BB -0.6323254 0.620280 ## Table of Chi-Square statistic terms by cell ## Diabetic Normal ## Bborbb 2.1990950 2.1161103 ## BB 0.3998355 0.3847473 ## Chi-Square Statistic: 5.099788 ## degrees of freedom: 1 ## P-Value : 0.02392877 # The p-Value is 0.0239, which is significant at nominal alpha/size level of 0.05. # From the output, we see that the expected counts assuming indepndence are # all greater than 5, so we are not overly concerned with # the chi-square distribution approximation to the chi-square statistic # under the null hypothesis of independence (of row and column factors) statisticsassignmenthelp.com
  • 8. Problem_13_8_25.r #Problem_13_8_25.r # # Custom function implementing chisqtest fcn.chisqtest<-function(tableA){ cat("n Two- Way Table: n") print(tableA) n.total=sum(as.vector(tableA)) cat("n Total Counts in Table: ", n.total,"n") # Compute marginal probabilities of # TattooStatus and of HepCStatus probs.TattooStatus=rowSums(tableA)/n.total probs.HepCStatus=colSums(tableA)/n.total cat("n MLEs of row level probabilitiesn") print(probs.TattooStatus) cat("n MLEs of column level probabilitiesn") print(probs.HepCStatus) # Compute table of fitted cell probabilities and # expected counts assuming independence of two factors tableA.fittedprobs=as.matrix(probs.TattooStatus)%*% t( as.matrix(probs.HepCStatus) ) cat("n Fitted cell probabilities assuming independencen") print(tableA.fittedprobs) tableA.expected=n.total* tableA.fittedprobs cat("n Expected Counts assuming independence n") print(tableA.expected) # Compute standardized residuals fitted table tableA.chisqresiduals=((tableA - tableA.expected))/sqrt(tableA.expected) cat("n Table of Chi-Square Residuals by celln") print(tableA.chisqresiduals) # Compute table of chi-square test statistic contributions tableA.chisqterms=((tableA - tableA.expected)^2)/tableA.expected cat("n Table of Chi-Square statistic terms by celln") print(tableA.chisqterms) tableA.chisqStatistic=sum(as.vector(tableA.chisqterms)) cat("n Chi-Square Statistic: ",tableA.chisqStatistic,"n") df.tableA=(nrow(tableA)-1)*(ncol(tableA)-1) cat("n degrees of freedom: ", df.tableA, "n") tableA.chisqStatistic.pvalue=1- pchisq(tableA.chisqStatistic, df=df.tableA) cat("n P-Value : ", tableA.chisqStatistic.pvalue, "nn") } ############### # 1. Problem 25: Physicians Health Study Tattoo/HepC Two-Way Table ---- tableD=data.frame( Asprin=rbind( MCIFatal=10, MCINonFatal=129, StrokeFatal=9, StrokeNonFatal=110), Placebo=rbind( MCIFatal=26, MCINonFatal=213, StrokeFatal=6, StrokeNonFatal=92) ) tableD.colSums=colSums(tableD) tableD.1<-rbind(tableD, None=((tableD.colSums*-1) +c(11037, 11034))) # (a). Test 1 # Chisquare test of homogenity -- rates are same # for Aspirin population and Placebo population fcn.chisqtest(tableD.1) statisticsassignmenthelp.com
  • 9. ## ## Two-Way Table: ## Asprin Placebo ## MCIFatal 10 26 ## MCINonFatal 129 213 ## StrokeFatal 9 6 ## StrokeNonFatal 110 92 ## None 10779 10697 ## ## Total Counts in Table: 22071 ## ## MLEs of row level probabilities ## MCIFatal MCINonFatal StrokeFatal StrokeNonFatal None ## 0.0016310996 0.0154954465 0.0006796248 0.0091522813 0.9730415477 ## ## MLEs of column level probabilities ## Asprin Placebo ## 0.500068 0.499932 ## Fitted cell probabilities assuming independence ## Asprin Placebo ## MCIFatal 0.0008156607 0.0008154390 ## MCINonFatal 0.0077487764 0.0077466701 ## StrokeFatal 0.0003398586 0.0003397662 ## StrokeNonFatal 0.0045767626 0.0045755186 ## None 0.4865869042 0.4864546435 ## ## Expected Counts assuming independence ## Asprin Placebo ## MCIFatal 18.002447 17.997553 ## MCINonFatal 171.023243 170.976757 ## StrokeFatal 7.501019 7.498981 ## StrokeNonFatal 101.013728 100.986272 ## None 10739.459562 10736.540438 ## ## Table of Chi-Square Residuals by cell ## Asprin Placebo ## MCIFatal -1.8860666 1.8863230 ## MCINonFatal -3.2133793 3.2138162 ## StrokeFatal 0.5473131 -0.5473875 ## StrokeNonFatal 0.8941067 -0.8942282 statisticsassignmenthelp.com
  • 10. ## None 0.3815489 -0.3816008 ## ## Table of Chi-Square statistic terms by cell ## Asprin Placebo ## MCIFatal 3.5572472 3.5582143 ## MCINonFatal 10.3258068 10.3286142 ## StrokeFatal 0.2995516 0.2996331 ## StrokeNonFatal 0.7994268 0.7996441 ## None 0.1455796 0.1456192 ## ## Chi-Square Statistic: 30.25934 ## ## degrees of freedom: 4 ## ## P-Value : 4.33405e-06 # Results significant, with MCIFatal and MCINonFatal significantly # lower for Aspirin versus Placebo (see the chisq residuals) # (a). Test 2 # Analyse total incidence of myocardial infarction tableD.2=rbind( MCITotal=colSums(tableD.1[1:2,]), Other=colSums(tableD.1[3:5,])) print(tableD.2) ## Asprin Placebo ## MCITotal 139 239 ## Other 10898 10795fcn.chisqtest(tableD.2) statisticsassignmenthelp.com
  • 11. ## ## Two-Way Table: ## Asprin Placebo ## MCITotal 139 239 ## Other 10898 10795 ## Total Counts in Table: 22071 ## ## MLEs of row level probabilities ## MCITotal Other ## 0.01712655 0.98287345 ## ## MLEs of column level probabilities ## Asprin Placebo ## 0.500068 0.499932 ## Fitted cell probabilities assuming independence ## Asprin Placebo ## MCITotal 0.008564437 0.008562109 ## Other 0.491503525 0.491369928 ## Expected Counts assuming independence ## Asprin Placebo ## MCITotal 189.0257 188.9743 ## Other 10847.9743 10845.0257 ## Table of Chi-Square Residuals by cell ## Asprin Placebo ## MCITotal -3.6385862 3.6390808 ## Other 0.4803068 -0.4803721 ## ## Table of Chi-Square statistic terms by cell ## Asprin Placebo ## MCITotal 13.2393097 13.2429093 ## Other 0.2306947 0.2307574 ## ## Chi-Square Statistic: 26.94367 ## ## degrees of freedom: 1 ## ## P-Value : 2.09472e-07 # Total incidence of MCI is significantly reduced by aspirin # (a). Test 3 # Analyse incidence of fatal and nonfatal tableD.3=rbind( FatalNonFatal=colSums(tableD.1[c(1,2,3,4),]), Other=colSums(tableD.1[c(5),])) fcn.chisqtest(tableD.3) statisticsassignmenthelp.com
  • 12. ## ## Two-Way Table: ## Asprin Placebo ## FatalNonFatal 258 337 ## Other 10779 10697 ## ## Total Counts in Table: 22071 ## ## MLEs of row level probabilities ## FatalNonFatal Other ## 0.02695845 0.97304155 ## ## MLEs of column level probabilities ## Asprin Placebo ## 0.500068 0.499932 ## ## Fitted cell probabilities assuming independence ## Asprin Placebo ## FatalNonFatal 0.01348106 0.01347739 ## Other 0.48658690 0.48645464 ## ## Expected Counts assuming independence ## Asprin Placebo ## FatalNonFatal 297.5404 297.4596 ## Other 10739.4596 10736.5404 ## ## Table of Chi-Square Residuals by cell ## Asprin Placebo ## FatalNonFatal -2.2922843 2.2925959 ## Other 0.3815489 -0.3816008 ## ## Table of Chi-Square statistic terms by cell ## Asprin Placebo ## FatalNonFatal 5.2545672 5.2559958 ## Other 0.1455796 0.1456192 ## ## Chi-Square Statistic: 10.80176 ## ## degrees of freedom: 1 ## ## P-Value : 0.001014035 # Incidence of cardiovascular events is lower under Aspirin vs Placebo # but the significance is lower (though still significant relative to nominal levels) # (a). Test 4 # Among those having MCI, evaluate whether # fatality rate depends on Aspirin versus Placebo fcn.chisqtest(tableD.1[1:2,]) statisticsassignmenthelp.com
  • 13. ## ## Two-Way Table: ## Asprin Placebo ## MCIFatal 10 26 ## MCINonFatal 129 213 ## ## Total Counts in Table: 378 ## ## MLEs of row level probabilities ## MCIFatal MCINonFatal ## 0.0952381 0.9047619 ## ## MLEs of column level probabilities ## Asprin Placebo ## 0.3677249 0.6322751 ## ## Fitted cell probabilities assuming independence ## Asprin Placebo ## MCIFatal 0.03502142 0.06021668 ## MCINonFatal 0.33270345 0.57205845 ## ## Expected Counts assuming independence ## Asprin Placebo ## MCIFatal 13.2381 22.7619 ## MCINonFatal 125.7619 216.2381 ## ## Table of Chi-Square Residuals by cell ## Asprin Placebo ## MCIFatal -0.8899731 0.6787117 ## MCINonFatal 0.2887454 -0.2202031 ## ## Table of Chi-Square statistic terms by cell ## Asprin Placebo ## MCIFatal 0.7920521 0.46064953 ## MCINonFatal 0.0833739 0.04848942 ## ## Chi-Square Statistic: 1.384565 ## ## degrees of freedom: 1 ## ## P-Value : 0.2393251 statisticsassignmenthelp.com
  • 14. # Not significant # (a). Test 5 Incidence of strokes tableD.4=rbind( Strokes=colSums(tableD.1[c(3,4),]), Other=colSums(tableD.1[c(1,2,5),])) fcn.chisqtest(tableD.4) ## ## Two-Way Table: ## Asprin Placebo ## Strokes 119 98 ## Other 10918 10936 ## ## Total Counts in Table: 22071 ## ## MLEs of row level probabilities ## Strokes Other ## 0.009831906 0.990168094 ## ## MLEs of column level probabilities ## Asprin Placebo ## 0.500068 0.499932 ## ## Fitted cell probabilities assuming independence ## Asprin Placebo ## Strokes 0.004916621 0.004915285 ## Other 0.495151341 0.495016753 ## ## Expected Counts assuming independence ## Asprin Placebo ## Strokes 108.5147 108.4853 ## Other 10928.4853 10925.5147 ## ## Table of Chi-Square Residuals by cell ## Asprin Placebo ## Strokes 1.0065480 -1.0066848 ## Other -0.1002995 0.1003132 ## ## Table of Chi-Square statistic terms by cell ## Asprin Placebo ## Strokes 1.013139 1.01341436 ## Other 0.010060 0.01006273 ## ## Chi-Square Statistic: 2.046676 ## ## degrees of freedom: 1 ## ## P-Value : 0.1525389 statisticsassignmenthelp.com
  • 15. # Not significantly different # (b). Table of cariovascular mortality tableE=data.frame( Asprin=rbind( AcuteMCI=10, OtherIHD=24, SuddenDeath=22, Stroke=10, OtherCard=15), Placebo=rbind( AcuteMCI=28, OtherIHD=25, SuddenDeath=12, Stroke=7, OtherCard=11)) tableE.colSums=colSums(tableE) tableE.1<-rbind(tableE, None=((tableE.colSums*-1) +c(11037, 11034)) ) tableE.1 ## Asprin Placebo ## AcuteMCI 10 28 ## OtherIHD 24 25 ## SuddenDeath 22 12 ## Stroke 10 7 ## OtherCard 15 11 ## None 10956 10951fcn.chisqtest(tableE.1) statisticsassignmenthelp.com
  • 16. ## ## Two-Way Table: ## Asprin Placebo ## AcuteMCI 10 28 ## OtherIHD 24 25 ## SuddenDeath 22 12 ## Stroke 10 7 ## OtherCard 15 11 ## None 10956 10951 ## ## Total Counts in Table: 22071 ## ## MLEs of row level probabilities ## AcuteMCI OtherIHD SuddenDeath Stroke OtherCard ## 0.0017217163 0.0022201078 0.0015404830 0.0007702415 0.0011780164 ## None ## 0.9925694350 ## ## MLEs of column level probabilities ## Asprin Placebo ## 0.500068 0.499932 ## ## Fitted cell probabilities assuming independence ## Asprin Placebo ## AcuteMCI 0.0008609752 0.0008607411 ## OtherIHD 0.0011102048 0.0011099030 ## SuddenDeath 0.0007703462 0.0007701368 ## Stroke 0.0003851731 0.0003850684 ## OtherCard 0.0005890883 0.0005889281 ## None 0.4963521750 0.4962172600 ## ## Expected Counts assuming independence ## Asprin Placebo ## AcuteMCI 19.002583 18.997417 ## OtherIHD 24.503330 24.496670 ## SuddenDeath 17.002311 16.997689 ## Stroke 8.501155 8.498845 ## OtherCard 13.001767 12.998233 statisticsassignmenthelp.com
  • 17. ## None 10954.988854 10952.011146 ## ## Table of Chi-Square Residuals by cell ## Asprin Placebo ## AcuteMCI -2.065193737 2.065474468 ## OtherIHD -0.101681138 0.101694960 ## SuddenDeath 1.212035322 -1.212200079 ## Stroke 0.514064534 -0.514134412 ## OtherCard 0.554172450 -0.554247781 ## None 0.009660683 -0.009661996 ## ## Table of Chi-Square statistic terms by cell ## Asprin Placebo ## AcuteMCI 4.2650251718 4.266185e+00 ## OtherIHD 0.0103390539 1.034186e-02 ## SuddenDeath 1.4690296219 1.469429e+00 ## Stroke 0.2642623446 2.643342e-01 ## OtherCard 0.3071071045 3.071906e-01 ## None 0.0000933288 9.335417e-05 ## ## Chi-Square Statistic: 12.63343 ## ## degrees of freedom: 5 ## ## P-Value : 0.0270671 statisticsassignmenthelp.com
  • 18. # Mortality due to AcuteMCI is significantly reduced by Aspirin # The P-value is 0.027 # (b). Test 2 # Evaluation of total cariovascular mortality: tableE.2<-rbind(TotalCard=colSums(tableE.1[c(1:5),]), None=tableE.1[6,]) fcn.chisqtest(tableE.2) ## ## Two-Way Table: ## Asprin Placebo ## TotalCard 81 83 ## None 10956 10951 ## ## Total Counts in Table: 22071 ## ## MLEs of row level probabilities ## TotalCard None ## 0.007430565 0.992569435 ## ## MLEs of column level probabilities ## Asprin Placebo ## 0.500068 0.499932 ## ## Fitted cell probabilities assuming independence ## Asprin Placebo ## TotalCard 0.003715787 0.003714777 ## None 0.496352175 0.496217260 ## ## Expected Counts assuming independence ## Asprin Placebo ## TotalCard 82.01115 81.98885 ## None 10954.98885 10952.01115 ## ## Table of Chi-Square Residuals by cell ## Asprin Placebo ## TotalCard -0.111654791 0.111669969 ## None 0.009660683 -0.009661996 ## ## Table of Chi-Square statistic terms by cell ## Asprin Placebo ## TotalCard 0.0124667923 1.247018e-02 ## None 0.0000933288 9.335417e-05 ## ## Chi-Square Statistic: 0.02512366 ## ## degrees of freedom: 1 ## ## P-Value : 0.8740593 # Not significant statisticsassignmenthelp.com