R_codes_for_chapter_10

R_codes_for_chapter_10 - Nonparametric Statistics 1 R for...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Nonparametric Statistics 1 R for Statistical Computing R codes for Example 10.3 : With n pairs of untied observations, i.e., n = r + s and w = max ( r,s ), the sign test can be carried out using the following sentence: 2*(1-pbinom(w-1,n,0.5)) Codes for sign test : #Sign test x <- c(9, 5, 9 ,10, 13, 8, 8, 13, 18, 30) y <- c(10, 6, 9, 8, 11, 4, 1, 3, 3, 10) 2*(1-pbinom(7-1,9,0.5)) Output : [1] 0.1796875 Codes for large sample sign test : #Large sample sign test z = 2 n = 9 p = 0.5 prop.test(z, n, p,correct=FALSE) #no continuity correction Output : 1-sample proportions test without continuity correction data: z out of n, null probability p X-squared = 2.7778, df = 1, p-value = 0.09558 alternative hypothesis: true p is not equal to 0.5 95 percent confidence interval: 0.06322511 0.54741103 sample estimates:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Nonparametric Statistics 2 p 0.2222222 Warning message: Chi-squared approximation may be incorrect in: prop.test (z, n, p, correct = FALSE) R codes for Example 10.4 : Example 10.4 is a situation of a paired comparison with ties. In that case, the appropriate R package to use is wilcox.exact. The package wilcox.exact is stored in
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/16/2011 for the course STAT 5407 taught by Professor Frade during the Fall '09 term at FSU.

Page1 / 5

R_codes_for_chapter_10 - Nonparametric Statistics 1 R for...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online