{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

R_codes_for_chapter_10

# R_codes_for_chapter_10 - Nonparametric Statistics 1 R for...

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

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:

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

View Full Document
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 the library exactRankTests, which is one of the contributed libraries in R. To use
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online