Publications by Ken Kleinman

Example 2014.11: Contrasts the basic way for R

30.09.2014

As we discuss in section 6.1.4 of the second edition, R and SAS handle categorical variables and their parameterization in models quite differently. SAS treats them on a procedure-by-procedure basis, which leads to some odd differences in capabilities and default parameterizations. For example, in the logistic procedure, the default...

2748 sym R (1143 sym/5 pcs) 14 img

Example 2014.12: Changing repeated measures data from wide to narrow format

21.10.2014

Data with repeated measures often come to us in the “wide” format, as shown below for the HELP data set we use in our book. Here we show just an ID, the CESD depression measure from four follow-up assessments, plus the baseline CESD. Obs ID CESD1 CESD2 CESD3 CESD4 CESD 1 1 7 . 8 ...

5714 sym R (2722 sym/9 pcs) 14 img

RStudio in the cloud for dummies, 2014/2015 edition

02.12.2014

In 2012, we presented a post showing how to run RStudio in the cloud on an Amazon server. There were 7 steps, including one with 7 sub-steps, one of which had 6 sub-sub-steps. It was still pretty easy, for what it was– an effectively free computer in the cloud to run R on. Today, we show the modern– 3 years later!– way to get...

4648 sym R (196 sym/4 pcs) 14 img

Example 2015.1: Time to refinance?

05.01.2015

In the US, it’s typical to borrow a fairly substantial portion of the cost of a new house from a bank. The cost of these loans, the mortgage rate, varies over time depending on what the financial wizards see in their crystal balls. What this means over time is that when the mortgage rates go down, the cost of living in your own ho...

3578 sym R (2052 sym/4 pcs) 14 img

Write in-line equations in your Shiny application with MathJax

30.12.2015

I’ve been working on a Shiny app and wanted to display some math equations. It’s possible to use LaTeX to show math using MathJax, as shown in this example from the makers of Shiny. However, by default, MathJax does not allow in-line equations, because the dollar sign is used so frequently. But I needed to use in-line math in m...

2064 sym R (1892 sym/1 pcs) 14 img

Write in-line equations in your Shiny application with MathJax

30.12.2015

I’ve been working on a Shiny app and wanted to display some math equations. It’s possible to use LaTeX to show math using MathJax, as shown in this example from the makers of Shiny. However, by default, MathJax does not allow in-line equations, because the dollar sign is used so frequently. But I needed to use in-line math in m...

2064 sym R (1684 sym/1 pcs) 14 img

Set up RStudio in the cloud to work with GitHub

17.01.2016

I love GitHub for version control and collaboration, though I’m no master of it. And the tools for integrating git and GitHub with RStudio are just amazing boons to productivity. Unfortunately, my University-supplied computer does not play well with GitHub. Various directories are locked down, and I can’t push or pull to GitHub...

5175 sym 14 img

Set up RStudio in the cloud to work with GitHub

17.01.2016

I love GitHub for version control and collaboration, though I’m no master of it. And the tools for integrating git and GitHub with RStudio are just amazing boons to productivity. Unfortunately, my University-supplied computer does not play well with GitHub. Various directories are locked down, and I can’t push or pull to GitHub...

5111 sym 14 img

RStudio in the cloud with Amazon Lightsail and docker

01.12.2016

About two years ago we published a quick and easy guide to setting up your own RStudio server in the cloud using the Docker service and Digital Ocean. The process is incredibly easy– about the only cumbersome part is retyping a random password. Today the excitement in virtual private servers is that Amazon is getting into the market, with the...

3292 sym 14 img