pchisqC: Comparing Logistic Regression Models with Chi-Squared Test

Description Usage Arguments Value Examples

View source: R/pchisqC.r

Description

Comparing Logistic Regression Models with Chi-Squared Test

Usage

1
pchisqC(reduced, full, digits = 3)

Arguments

reduced

The reduced logisitic regression model as an object. This is model with fewer independent variables.

full

The full logisitic regression model as an object. This is model with more independent variables.

digits

The number of digits to display after decimal point, default is 3.

Value

The chi-squared statistic, df, and p-value as a vector of numbers to test null hypothesis that full model no better than reduced model.

Examples

1
2
3
4
5
6
7
   library(poliscidata)
   
   obama_vote_model_reduced <- svyglm(obama_vote ~ ft_dem + white, design=nesD, 
                                      family="quasibinomial")
   obama_vote_model_full <- svyglm(obama_vote ~ ft_dem + white + (owngun_owngun=="1. Yes"), 
                                   design=nesD, family="quasibinomial")
   pchisqC(obama_vote_model_reduced, obama_vote_model_full)

Example output

Warning: These models have different numbers of observations.
[1] "<.001"

poliscidata documentation built on July 8, 2020, 6:23 p.m.