Running examples in ‘rockchalk-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: plotSlopes
> ### Title: Generic function for plotting regressions and interaction
> ###   effects
> ### Aliases: plotSlopes plotSlopes.lm
> 
> ### ** Examples
> 
> ## Manufacture some predictors
> set.seed(12345)
> 
> dat <- genCorrelatedData2 (N = 100, means = rep(0,4), sds = 1, rho = 0.2,
+                            beta = c(0.3, 0.5, -0.45, 0.5, -0.1, 0, 0.6),
+                            stde = 2)
[1] "The equation that was calculated was"
y = 0.3 + 0.5*x1 + -0.45*x2 + 0.5*x3 + -0.1*x4 
 + 0*x1*x1 + 0.6*x2*x1 + 0*x3*x1 + 0*x4*x1 
 + 0*x1*x2 + 0*x2*x2 + 0*x3*x2 + 0*x4*x2 
 + 0*x1*x3 + 0*x2*x3 + 0*x3*x3 + 0*x4*x3 
 + 0*x1*x4 + 0*x2*x4 + 0*x3*x4 + 0*x4*x4 
 + N(0,2) random error 
> 
> dat$xcat1 <- gl(2, 50, labels = c("M", "F"))
> dat$xcat2 <- cut(rnorm(100), breaks = c(-Inf, 0, 0.4, 0.9, 1, Inf),
+                  labels = c("R", "M", "D", "P", "G"))
> ## incorporate effect of categorical predictors
> dat$y <- dat$y + 1.9 * dat$x1 * contrasts(dat$xcat1)[dat$xcat1] +
+            contrasts(dat$xcat2)[dat$xcat2 , ] %*% c(0.1, -0.1, 0, 0.2)
> 
> m1 <- lm(y ~ x1 * x2 + x3 + x4 + xcat1 + xcat2, data = dat)
> summary(m1)

Call:
lm(formula = y ~ x1 * x2 + x3 + x4 + xcat1 + xcat2, data = dat)

Residuals:
    Min      1Q  Median      3Q     Max 
-5.4443 -1.3172 -0.0451  1.2582  3.9497 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   0.5197     0.3622   1.435  0.15477    
x1            1.4957     0.2098   7.129 2.44e-10 ***
x2           -0.4418     0.2161  -2.045  0.04380 *  
x3            0.8292     0.2318   3.578  0.00056 ***
x4           -0.6045     0.2091  -2.892  0.00481 ** 
xcat1F       -0.5292     0.4065  -1.302  0.19626    
xcat2M        0.2458     0.6957   0.353  0.72475    
xcat2D       -0.4425     0.5028  -0.880  0.38113    
xcat2G        0.7148     0.5884   1.215  0.22765    
x1:x2         1.1168     0.2122   5.262 9.59e-07 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 2 on 90 degrees of freedom
Multiple R-squared:  0.5385,	Adjusted R-squared:  0.4924 
F-statistic: 11.67 on 9 and 90 DF,  p-value: 5.872e-12

> 
> ## New in rockchalk 1.7.x. No modx required:
> plotSlopes(m1, plotx = "x1")
> 
> ## Confidence interval, anybody?
> plotSlopes(m1, plotx = "x1", interval = "conf")
> 
> ## Prediction interval.
> plotSlopes(m1, plotx = "x1", interval = "pred")
> 
> ## Now experiment with a moderator variable
> ## let default quantile algorithm do its job
> plotSlopes(m1, plotx = "x1", modx = "x2")
> ## previous uses default equivalent to
> ## plotSlopes(m1, plotx = "x1", modx = "x2", modxVals = "quantile")
> ## Want more focal values?
> plotSlopes(m1, plotx = "x1", modx = "x2", n = 5)
> ## Pick focal values yourself?
> plotSlopes(m1, plotx = "x1", modx = "x2", modxVals = c(-2, 0, 0.5))
> ## Alternative algorithm?
> plotSlopes(m1, plotx = "x1", modx = "x2", modxVals = "std.dev.",
+            main = "Uses \"std.dev.\" Divider for the Moderator",
+            xlab = "My Predictor", ylab = "Write Anything You Want for ylab")
> 
> ## Will catch output object from this one
> m1ps <- plotSlopes(m1, plotx = "x1", modx = "x2", modxVals = "std.dev.", n = 5,
+                  main = "Setting n = 5 Selects More Focal Values for Plotting")
> 
> m1ts <- testSlopes(m1ps)
Values of x2 OUTSIDE this interval:
        lo         hi 
-2.1985386 -0.8775335 
cause the slope of (b1 + b2*x2)x1 to be statistically significant
> 
> plot(m1ts)
> 
> ### Examples with categorical Moderator variable
> 
> m3 <- lm (y ~ x1 + xcat1, data = dat)
> summary(m3)

Call:
lm(formula = y ~ x1 + xcat1, data = dat)

Residuals:
    Min      1Q  Median      3Q     Max 
-5.6824 -1.6307 -0.0911  1.3648  7.7935 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   0.4646     0.3460   1.343    0.182    
x1            1.3714     0.2375   5.774 9.31e-08 ***
xcat1F       -0.3713     0.4905  -0.757    0.451    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 2.446 on 97 degrees of freedom
Multiple R-squared:  0.2564,	Adjusted R-squared:  0.241 
F-statistic: 16.72 on 2 and 97 DF,  p-value: 5.765e-07

> plotSlopes(m3, modx = "xcat1", plotx = "x1")
> plotSlopes(m3, modx = "xcat1", plotx = "x1", interval = "predict")
> 
> 
> m4 <- lm (y ~ x1 * xcat1, data = dat)
> summary(m4)

Call:
lm(formula = y ~ x1 * xcat1, data = dat)

Residuals:
    Min      1Q  Median      3Q     Max 
-4.9788 -1.5024  0.1503  1.3353  5.0121 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   0.4277     0.2965   1.442    0.152    
x1            0.3434     0.2659   1.292    0.200    
xcat1F       -0.5108     0.4210  -1.213    0.228    
x1:xcat1F     2.4830     0.4132   6.009 3.34e-08 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 2.096 on 96 degrees of freedom
Multiple R-squared:  0.4596,	Adjusted R-squared:  0.4428 
F-statistic: 27.22 on 3 and 96 DF,  p-value: 7.973e-13

> plotSlopes(m4, modx = "xcat1", plotx = "x1")
> plotSlopes(m4, modx = "xcat1", plotx = "x1", interval = "conf")
> 
> 
> m5 <- lm (y ~ x1 + x2 + x1 * xcat2, data = dat)
> summary(m5)

Call:
lm(formula = y ~ x1 + x2 + x1 * xcat2, data = dat)

Residuals:
    Min      1Q  Median      3Q     Max 
-4.1285 -1.8316 -0.0913  1.5490  6.5085 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  0.21281    0.34349   0.620 0.537109    
x1           1.22389    0.35402   3.457 0.000832 ***
x2           0.03066    0.24214   0.127 0.899510    
xcat2M       0.03390    0.79419   0.043 0.966043    
xcat2D      -0.85764    0.59158  -1.450 0.150573    
xcat2G       1.21127    0.67510   1.794 0.076101 .  
x1:xcat2M    0.67280    1.11990   0.601 0.549490    
x1:xcat2D    0.99438    0.52307   1.901 0.060459 .  
x1:xcat2G   -1.25123    0.67044  -1.866 0.065225 .  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 2.326 on 91 degrees of freedom
Multiple R-squared:  0.3689,	Adjusted R-squared:  0.3134 
F-statistic: 6.648 on 8 and 91 DF,  p-value: 8.066e-07

> plotSlopes(m5, modx = "xcat2", plotx = "x1")
> m5ps <- plotSlopes(m5, modx = "xcat2", plotx = "x1", interval = "conf")
> 
> testSlopes(m5ps)
These are the straight-line "simple slopes" of the variable x1  
 for the selected moderator values. 
    "xcat2"       slope Std. Error    t value     Pr(>|t|)
R        x1  1.22388617  0.3540165  3.4571443 8.319009e-04
M x1:xcat2M  1.89668117  1.0676543  1.7764938 7.899357e-02
D x1:xcat2D  2.21826402  0.3839151  5.7780074 1.045413e-07
G x1:xcat2G -0.02734099  0.5707752 -0.0479015 9.618997e-01
> 
> 
> 
> ## Now examples with real data. How about Chilean voters?
> library(car)
Error in library(car) : there is no package called ‘car’
Execution halted