Tuesday, June 25, 2013

Sample size calculations equivalent to Stata functions


8 comments:

  1. Slawa, Super nice article! Thanks for sharing your work. I noticed that this article is not appearing properly in r-bloggers.com (at least in Chrome). This may be a result of knitr?

    ReplyDelete
    Replies
    1. Thanks! Yeah I saw that too and was disappointed. Not sure how to fix this. I'll have to play around with it.

      Delete
  2. Looks great, but Blogger cut off your x-axis label. I was curious, so I stepped through and pasted together a barebones .Rmd file of my own -- basically with all your function definitions and minus all the LaTeX -- so I could replicate the final call to graph.power.prop().

    So, how did you make knitr work with Blogger anyway? Did you just paste the source of the output of Knit HTML into the post editor?

    ReplyDelete
    Replies
    1. Thanks. That's strange. It looks ok for me. The label is just "n (in smaller arm)" - this is not showing up when you look at it?

      Right now, I save the rmd file as an html into a public dropbox folder and then use an iframe script in blogger to reference that file. Somebody else was doing this on another blog, but if you have a better idea, I'm all for it. It did not show up great on the blogger website this way.

      Delete
    2. Nevermind, you're right. Must be my 12in screen. I only see the tick marks on the x axis, none of the numbers or the axis label. But on R-bloggers in Feedly the picture looks as intended.

      I have no better ideas about using knitr for blogging; I only ever use it for pdf output. But I like it a lot and I'd blog with it if it were easy. There used to be an RWordPress package, but the .tar.gz source file is no longer available and there never was a binary, it seems.

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Stata 13 just added a great deal under this heading. The entire documentation is accessible to all via http://www.stata.com/bookstore/power-sample-size-reference-manual/

    ReplyDelete
    Replies
    1. Thanks for your comment- yes I'm excited to try out the new stuff in Stata 13. Lots of new capabilities, especially for graphing sample size and power.

      Delete