prop.testC: Difference of Proportions Test

Description Usage Arguments Value Examples

View source: R/prop.testC.r

Description

Difference of proportions test with optional sample weights. Reports P-value of two-tailed significance test.

Usage

1
prop.testC(y, x, w = NULL, digits = 3)

Arguments

y

Dependent variable, should be coded as 0 or 1.

x

Independent variable, should have only two unique values.

w

Weights, optional.

digits

Number of digits to report after decimal place, optional (default = 3).

Value

No return

Examples

1
2
3
   library(poliscidata)
   
   prop.testC(nes$dem, nes$gender, w=nes$nesw)

Example output

     Proportions and Ns:
       Proportion    N
Male    0.3103642 2831
Female  0.3809429 3065
Total   0.3470555 5896

     Z-Test Statistics:
   Difference       Std.Err   Z-statistic       P-value 
-7.057876e-02  1.235307e-02 -5.713457e+00  5.535181e-09 

   Lower 95% CI    Upper 95% CI 
    -0.09479033     -0.04636718 

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