Re: [R] exclude1 in summary.formula from Hmisc
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. 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 ? Regards. David [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] exclude1 in summary.formula from Hmisc
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 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] exclude1 in summary.formula from Hmisc
david dav wrote: > Dear Users, > Still having troubles with sharing my results, I'm trying to display a > contingency table using summary.formula. > Computing works well but I'd like to display information on redundant > entries say, males AND females. Please tell us what output you got. And it is sometimes helpful to get a trivial example of the failure with simulated data. Also see a related parameter "long". Frank > I wonder if this code is correct : > > desqualjum <- summary.formula(varqual1$X ~., data = subset( varqual1, > select = -X), method = "reverse", overall = T, test = T, exclude1 = FALSE) > where varqual1 is the data frame containing the variable "sex". > > I'm using R 2.5.1 and Hmisc 3.4-2 on a Mac (OSX.4, intel) but I had the > same trouble with former versions of R and the package. > > Thank you for your help. > David > > [[alternative HTML version deleted]] > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] exclude1 in summary.formula from Hmisc
Dear Users, Still having troubles with sharing my results, I'm trying to display a contingency table using summary.formula. Computing works well but I'd like to display information on redundant entries say, males AND females. I wonder if this code is correct : desqualjum <- summary.formula(varqual1$X ~., data = subset( varqual1, select = -X), method = "reverse", overall = T, test = T, exclude1 = FALSE) where varqual1 is the data frame containing the variable "sex". I'm using R 2.5.1 and Hmisc 3.4-2 on a Mac (OSX.4, intel) but I had the same trouble with former versions of R and the package. Thank you for your help. David [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.