Blog Archives

Plotting forecast() objects in ggplot part 1: Extracting the Data

March 13, 2012
By

Lately I've been using Rob J Hyndman's excellent forecast package. The package comes with some built in plotting functions but I found I wanted to customize and make my own plots in ggplot. In order to do that, I need a generalizable function that will...

Read more »

Plotting forecast() objects in ggplot part 1: Extracting the Data

March 13, 2012
By

Lately I've been using Rob J Hyndman's excellent forecast package. The package comes with some built in plotting functions but I found I wanted to customize and make my own plots in ggplot. In order to do that, I need a generalizable function that will...

Read more »

Recovering Marginal Effects and Standard Errors of Interactions Terms Pt. II: Implement and Visualize

March 9, 2012
By
Recovering Marginal Effects and Standard Errors of Interactions Terms Pt. II: Implement and Visualize

In the last post I presented a function for recovering marginal effects of interaction terms. Here we implement the function with simulated data and plot the results using ggplot2.      #---Simulate Data and Fit a linear model with an...

Read more »

Recovering Marginal Effects and Standard Errors of Interactions Terms Pt. II: Implement and Visualize

March 9, 2012
By
Recovering Marginal Effects and Standard Errors of Interactions Terms Pt. II: Implement and Visualize

In the last post I presented a function for recovering marginal effects of interaction terms. Here we implement the function with simulated data and plot the results using ggplot2.      #---Simulate Data and Fit a linear model with an...

Read more »

Recovering Marginal Effects and Standard Errors from Interaction Terms in R

March 5, 2012
By

When I fit models with interactions, I often want to recover not only the interaction effect but also the marginal effect (the main effect + the interaction) and of course the standard errors. There are a couple of ways to do this in R but I ended writ...

Read more »

Recovering Marginal Effects and Standard Errors from Interaction Terms in R

March 5, 2012
By

When I fit models with interactions, I often want to recover not only the interaction effect but also the marginal effect (the main effect + the interaction) and of course the standard errors. There are a couple of ways to do this in R but I ended writ...

Read more »