Description Usage Arguments Value Note Author(s) Examples
Perform chi-square test for association or goodness of fit, by simulation. Enter either formula-data input or a summary table.
1 |
x |
Could be a formula. If so, it should be of the form ~var (for goodness of fit testing), or~var1+var2 (for association testing). Otherwise it is either a table or matrix of summary data. |
data |
data frame supplying variables for formula x. If variables in x are not found in the data, then they will be searched for in the parent environment. |
p |
Null probabilities in a goodness of fit test |
options |
passed to |
side effects
This is a locally-run Shiny app. It may not work properly on some R Studio Server set-ups, especially on the CentOS operating system. For best views, open the app in the browser.
Homer White hwhite0@georgetowncollege.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
# test for association, from a data frame:
chisqSh(~am+cyl,data=mtcars)
# test for association, from a summary table:
DoesNotSmoke <- c(NeitherSmokes=1168,OneSmokes=1823,BothSmoke=1380)
Smokes <- c(188,416,400)
ChildParents <- rbind(DoesNotSmoke,Smokes)
chisqSh(ChildParents)
# test for goodness of fit, from a data frame:
chisqSh(~cyl,data=mtcars,p=rep(1/3,3))
#test for goodness of fit, from a summary table:
obs <- c(one=8,two=18,three=11,four=7,five=9,six=7)
chisqSh(obs,p=rep(1/6,6))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.