wrapChiSqTest.data.frame | R Documentation |
Format ChiSqTest from data.
## S3 method for class 'data.frame'
wrapChiSqTest(
x,
predictionColumnName,
yColumnName,
...,
yTarget = TRUE,
nParameters = 1,
meany = mean(x[[yColumnName]] == yTarget),
na.rm = FALSE
)
x |
data frame containing columns to compare |
predictionColumnName |
character name of prediction column |
yColumnName |
character name of column containing dependent variable |
... |
extra arguments (not used) |
yTarget |
y value to consider positive |
nParameters |
number of variables in model |
meany |
(optional) mean of y |
na.rm |
logical, if TRUE remove NA values |
wrapped test
d <- data.frame(x=c(1,2,3,4,5,6,7,7),
y=c(TRUE,FALSE,FALSE,FALSE,TRUE,TRUE,TRUE,FALSE))
model <- glm(y~x, data=d, family=binomial)
summary(model)
d$pred <- predict(model,type='response',newdata=d)
render(wrapChiSqTest(d,'pred','y'),pLargeCutoff=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.