Running examples in 'mediation-Ex.R' failed
The error most likely occurred in:

> ### Name: mediate
> ### Title: Causal Mediation Analysis
> ### Aliases: mediate
> 
> ### ** Examples
> 
> # Examples with JOBS II Field Experiment
> 
> # **For illustration purposes a small number of simulations are used**
> 
> data(jobs)
> 
> ####################################################
> # Example 1: Linear Outcome and Mediator Models
> ####################################################
> b <- lm(job_seek ~ treat + econ_hard + sex + age, data=jobs)
> c <- lm(depress2 ~ treat + job_seek + econ_hard + sex + age, data=jobs)
> 
> # Estimation via quasi-Bayesian approximation
> contcont <- mediate(b, c, sims=50, treat="treat", mediator="job_seek")
> summary(contcont)

Causal Mediation Analysis 

Quasi-Bayesian Confidence Intervals

               Estimate 95% CI Lower 95% CI Upper p-value
ACME            -0.0171      -0.0415         0.01    0.12
ADE             -0.0325      -0.1229         0.05    0.40
Total Effect    -0.0496      -0.1323         0.03    0.28
Prop. Mediated   0.2457      -1.9818         2.41    0.24

Sample Size Used: 899 


Simulations: 50 

> plot(contcont)
> 
> ## Not run: 
> ##D # Estimation via nonparametric bootstrap
> ##D contcont.boot <- mediate(b, c, boot=TRUE, sims=50, treat="treat", mediator="job_seek")
> ##D summary(contcont.boot)
> ## End(Not run)
> 
> # Allowing treatment-mediator interaction
> d <- lm(depress2 ~ treat + job_seek + treat:job_seek + econ_hard + sex + age, data=jobs)
> contcont.int <- mediate(b, d, sims=50, treat="treat", mediator="job_seek")
> summary(contcont.int)

Causal Mediation Analysis 

Quasi-Bayesian Confidence Intervals

                         Estimate 95% CI Lower 95% CI Upper p-value
ACME (control)            -0.0156      -0.0489         0.01    0.40
ACME (treated)            -0.0104      -0.0400         0.01    0.40
ADE (control)             -0.0482      -0.1294         0.03    0.28
ADE (treated)             -0.0430      -0.1281         0.03    0.32
Total Effect              -0.0586      -0.1369         0.01    0.24
Prop. Mediated (control)   0.1938     -17.9416         2.04    0.48
Prop. Mediated (treated)   0.1320     -15.7464         1.04    0.48
ACME (average)            -0.0130      -0.0446         0.01    0.40
ADE (average)             -0.0456      -0.1280         0.03    0.32
Prop. Mediated (average)   0.1629     -16.8440         1.53    0.48

Sample Size Used: 899 


Simulations: 50 

> 
> # Allowing ``moderated mediation'' with respect to age
> b.int <- lm(job_seek ~ treat*age + econ_hard + sex, data=jobs)
> d.int <- lm(depress2 ~ treat*job_seek*age + econ_hard + sex, data=jobs)
> contcont.age20 <- mediate(b.int, d.int, sims=50, treat="treat", mediator="job_seek",
+ 			covariates = list(age = 20))
> 
> 			covariates = list(age = 70))
Error: unexpected ')' in "                        covariates = list(age = 70))"
Execution halted