hmisc

Sample size and power calculation in r as viable alternative to proc power in SAS?

≡放荡痞女 提交于 2019-12-05 07:48:05
So I am trying to see how close the sample size calculations (for two sample independent proportions with unequal samples sizes) are between proc power in SAS and some sample size functions in r. I am using the data found here at a UCLA website. The UCLA site gives parameters as follows: p1=.3,p2=.15,power=.8,null difference=0, and for the two-sided tests it assumes equal sample sizes; for the unequal sample size tests the parameters are the same, with group weights of 1 for group1 and 2 for group2, and the tests they perform are one-sided. I am using the r function pwr.t.test(n=NULL,d=0,sig

Hmisc::latex not printing caption w/ tabular object

一曲冷凌霜 提交于 2019-12-04 23:36:16
问题 First I will tell you what I'm attempting to do big picture in case I'm going about it wrong. I have a nested table that I'd like to out put as a LaTeX table within RStudio using knitr. I am fine until I try to add a caption. I tried the example on page 9 in the tables vignette (LINK). It works without the caption but when I add the caption it doesn't. It also works with a non tabular object. The funny thing is that latex.default works but causes an error in RStudio/knitr's Compile PDF and

Hmisc::latex not printing caption w/ tabular object

别说谁变了你拦得住时间么 提交于 2019-12-03 14:41:08
First I will tell you what I'm attempting to do big picture in case I'm going about it wrong. I have a nested table that I'd like to out put as a LaTeX table within RStudio using knitr. I am fine until I try to add a caption. I tried the example on page 9 in the tables vignette (LINK) . It works without the caption but when I add the caption it doesn't. It also works with a non tabular object. The funny thing is that latex.default works but causes an error in RStudio/knitr's Compile PDF and from what I read is called by latex anyway; plus the table isn't rounded appropriately anymore. I tried

Evaluation Error when tidyverse is loaded after Hmisc

本小妞迷上赌 提交于 2019-12-03 11:27:14
I am using r 3.3.3, dplyr 0.7.4, and Hmisc 4.1-1. I noticed that the order I load packages effects whether or not a dplyr::summaries function wold work or not. I understand that loading packages in a different order would mask certain functions but I am using the package::function() syntax to avoid that issue. The exact issue revolves around labeled variables. I know that there has been issues in the past with tidyverse and variable labels but none seem to address why this particular situation is occurring. First example that works - I load only Hmisc then dplyr and I am able to summaries the

Hmisc latex fuction need to remove the first line

好久不见. 提交于 2019-12-02 14:08:43
问题 Im using Hmisc in rmarkdown file. when I create a table this is what I do --- output: pdf_document --- ```{r Arrests Stats, results ='asis', message = FALSE, warning = FALSE, echo = FALSE} # render the table options(digits=1) library(Hmisc) latex(head(mtcars), file="") ``` The latex output has the first row showing as below %latex.default(cstats, title= title.... \begin{table}... . . . \end{tabular} Notice the '%' I need to figure out to remove the first line as it shows on the PDF document

Hmisc latex fuction need to remove the first line

醉酒当歌 提交于 2019-12-02 04:30:46
Im using Hmisc in rmarkdown file. when I create a table this is what I do --- output: pdf_document --- ```{r Arrests Stats, results ='asis', message = FALSE, warning = FALSE, echo = FALSE} # render the table options(digits=1) library(Hmisc) latex(head(mtcars), file="") ``` The latex output has the first row showing as below %latex.default(cstats, title= title.... \begin{table}... . . . \end{tabular} Notice the '%' I need to figure out to remove the first line as it shows on the PDF document when its weaved Looks like that's hard-coded into latex.default ( cat("%", deparse(sys.call()), "%\n",

divide a range of values in bins of equal length: cut vs cut2

匆匆过客 提交于 2019-11-30 08:39:29
I'm using the cut function to split my data in equal bins, it does the job but I'm not happy with the way it returns the values. What I need is the center of the bin not the upper and lower ends. I've also tried to use cut2{Hmisc} , this gives me the center of each bins, but it divides the range of data in bins that contains the same numbers of observations, rather than being of the same length. Does anyone have a solution to this? It's not too hard to make the breaks and labels yourself, with something like this. Here since the midpoint is a single number, I don't actually return a factor