[R] exclude1 in summary.formula from Hmisc

Frank E Harrell Jr f.harrell at vanderbilt.edu
Fri Jul 20 18:28:01 CEST 2007


david dav wrote:
> Here is a peace of the data and code :
> 
> sex <-c(2,2,1,1,1,1,1,1,1,2,1,1,1,1,1,2,2,1,1,2,2)
> AGN <- 
> c("C","C","C","C","C","A","A","C","B","B","C","C","C","C","C","C","B","B","C","C","C") 
> 
> X <- c(2,2,2,2,1,2,2,2,2,2,1,1,1,1,1,1,1,1,1,2,2)
> 
> varqual <- data.frame(sex,AGN,X)
> 
> desqual <- summary.formula(varqual$X ~.,  data = subset( varqual, select 
> = -X), method = "reverse",  overall = T, test = T, long = T, exclude1 = F)
> 
> desqual doesn't show the results for sex ==1 as it is redundant.
> I also tried long =T wich didn't change anything here.

Oh yes.  exclude1 is not an argument to summary.formula but is an 
argument to the print, plot, and latex methods.  So do print(desqual, 
exclude1=FALSE, long=TRUE).  Thanks for the reproducible example.

Note that you say summary( ) and don't need to type out summary.formula

> 
> Bonus question if I may :
> This function is a little bit complex for me and  I couldn't figure out 
> how to get either Yates' continuity correction or Fisher Test instead of 
> Chisquare. Does it ask a lot of program coding ?

Neither of those is recommended so they are not automatically supported. 
  But users can add their own test functions - see the help file for the 
catTest argument to summary.formula.  Fisher's test is conservative. 
The Yates' continuity correction tries to mimic the conservatism of 
Fisher's test.  I don't like to get larger P-values when I can avoid it. 
  And the recommendations about worrying about the chi-square 
approximation when some cell sizes are small are a bit overdone.  Better 
might be to use the likelihood ratio tests, and many other tests are 
available.

Frank

> 
> Regards.
> 
> David


-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University



More information about the R-help mailing list