@@ -127,7 +127,7 @@
Loading
127 127
        sbc    <- c(sbc, ols_sbc(fr$model))
128 128
        sbic   <- c(sbic, ols_sbic(fr$model, model))
129 129
        cp     <- c(cp, ols_mallows_cp(fr$model, model))
130 -
        rmse   <- c(rmse, sqrt(fr$ems))
130 +
        rmse   <- c(rmse, fr$rmse)
131 131
132 132
        if (progress) {
133 133
          if (interactive()) {
@@ -180,18 +180,23 @@
Loading
180 180
  }
181 181
182 182
  final_model <- lm(paste(response, "~", paste(preds, collapse = " + ")), data = l)
183 +
  
184 +
  metrics     <- data.frame(r2 = rsq[step], adj_r2 = adjrsq[step], aic = aic[step], 
185 +
                            sbic = sbic[step], sbc = sbc[step], mallows_cp = cp[step], 
186 +
                            rmse = rmse[step])
183 187
184 -
  out <- list(mallows_cp = cp,
185 -
              removed    = rpred,
186 -
              rsquare    = rsq,
188 +
  out <- list(adjr       = adjrsq,
189 +
              aic        = aic,
187 190
              indvar     = cterms,
188 -
              steps      = step,
189 -
              sbic       = sbic,
190 -
              adjr       = adjrsq,
191 +
              mallows_cp = cp,
192 +
              metrics    = metrics,
193 +
              model      = final_model,
194 +
              removed    = rpred,
191 195
              rmse       = rmse,
192 -
              aic        = aic,
196 +
              rsquare    = rsq,
193 197
              sbc        = sbc,
194 -
              model      = final_model)
198 +
              sbic       = sbic,
199 +
              steps      = step)
195 200
196 201
  class(out) <- "ols_step_backward_p"
197 202

@@ -318,14 +318,15 @@
Loading
318 318
319 319
  final_model <- lm(paste(response, "~", paste(preds, collapse = " + ")), data = l)
320 320
321 -
  out <- list(predictors = var_index,
322 -
              method     = method,
323 -
              steps      = all_step,
321 +
  out <- list(aic        = laic,
324 322
              arsq       = larsq,
325 -
              aic        = laic,
326 323
              ess        = less,
324 +
              method     = method,
325 +
              model      = final_model,
326 +
              predictors = var_index,
327 +
              rsq        = lrsq,
327 328
              rss        = lrss,
328 -
              rsq        = lrsq)
329 +
              steps      = all_step)
329 330
330 331
  class(out) <- "ols_step_both_aic"
331 332

@@ -65,7 +65,7 @@
Loading
65 65
}
66 66
67 67
rtwo <- function(i, mdata) {
68 -
  dat <- mdata[, c(-1, -i)]
68 +
  dat <- mdata[, c(-1, -i), drop = FALSE]
69 69
  summary(lm(mdata[[1]] ~ ., data = dat))[[8]]
70 70
}
71 71

@@ -138,7 +138,7 @@
Loading
138 138
139 139
140 140
  sbic    <- ols_sbic(fr$model, model)
141 -
  rmse    <- sqrt(fr$ems)
141 +
  rmse    <- fr$rmse
142 142
  betas   <- append(betas, fr$betas)
143 143
  lbetas  <- append(lbetas, length(fr$betas))
144 144
  pvalues <- append(pvalues, fr$pvalues)
@@ -203,7 +203,7 @@
Loading
203 203
      sbc       <- c(sbc, ols_sbc(fr$model))
204 204
      sbic      <- c(sbic, ols_sbic(fr$model, model))
205 205
      cp        <- c(cp, ols_mallows_cp(fr$model, model))
206 -
      rmse      <- c(rmse, sqrt(fr$ems))
206 +
      rmse      <- c(rmse, fr$rmse)
207 207
      betas     <- append(betas, fr$betas)
208 208
      lbetas    <- append(lbetas, length(fr$betas))
209 209
      pvalues   <- append(pvalues, fr$pvalues)
@@ -257,7 +257,7 @@
Loading
257 257
        sbc       <- c(sbc, ols_sbc(fr$model))
258 258
        sbic      <- c(sbic, ols_sbic(fr$model, model))
259 259
        cp        <- c(cp, ols_mallows_cp(fr$model, model))
260 -
        rmse      <- c(rmse, sqrt(fr$ems))
260 +
        rmse      <- c(rmse, fr$rmse)
261 261
        betas     <- append(betas, fr$betas)
262 262
        lbetas    <- append(lbetas, length(fr$betas))
263 263
        pvalues   <- append(pvalues, fr$pvalues)
@@ -308,6 +308,10 @@
Loading
308 308
  }
309 309
310 310
  final_model <- lm(paste(response, "~", paste(preds, collapse = " + ")), data = l)
311 +
  
312 +
  metrics     <- data.frame(r2 = rsq[all_step], adj_r2 = adjrsq[all_step], aic = aic[all_step], 
313 +
                            sbic = sbic[all_step], sbc = sbc[all_step], 
314 +
                            mallows_cp = cp[all_step], rmse = rmse[all_step])
311 315
312 316
  beta_pval <- data.frame(
313 317
    model     = rep(seq_len(all_step), lbetas),
@@ -317,24 +321,24 @@
Loading
317 321
  )
318 322
319 323
  out <- list(
320 -
    orders     = var_index,
324 +
    adjr       = adjrsq,
325 +
    aic        = aic,
326 +
    beta_pval  = beta_pval,
327 +
    betas      = betas,
328 +
    indvar     = cterms,
329 +
    lbetas     = lbetas,
330 +
    mallows_cp = cp,
321 331
    method     = method,
322 -
    steps      = all_step,
332 +
    metrics    = metrics,
333 +
    model      = final_model,
334 +
    orders     = var_index,
323 335
    predictors = preds,
336 +
    pvalues    = pvalues,
337 +
    rmse       = rmse,
324 338
    rsquare    = rsq,
325 -
    aic        = aic,
326 339
    sbc        = sbc,
327 340
    sbic       = sbic,
328 -
    adjr       = adjrsq,
329 -
    rmse       = rmse,
330 -
    mallows_cp = cp,
331 -
    indvar     = cterms,
332 -
    betas      = betas,
333 -
    lbetas     = lbetas,
334 -
    pvalues    = pvalues,
335 -
    beta_pval  = beta_pval,
336 -
    model      = final_model
337 -
  )
341 +
    steps      = all_step)
338 342
339 343
  class(out) <- "ols_step_both_p"
340 344

@@ -134,7 +134,7 @@
Loading
134 134
  aic    <- ols_aic(fr$model)
135 135
  sbc    <- ols_sbc(fr$model)
136 136
  sbic   <- ols_sbic(fr$model, model)
137 -
  rmse   <- sqrt(fr$ems)
137 +
  rmse   <- fr$rmse
138 138
139 139
  if (details) {
140 140
    cat("\n")
@@ -186,7 +186,7 @@
Loading
186 186
      sbc    <- c(sbc, ols_sbc(fr$model))
187 187
      sbic   <- c(sbic, ols_sbic(fr$model, model))
188 188
      cp     <- c(cp, ols_mallows_cp(fr$model, model))
189 -
      rmse   <- c(rmse, sqrt(fr$ems))
189 +
      rmse   <- c(rmse, fr$rmse)
190 190
191 191
      if (details) {
192 192
        cat("\n")
@@ -243,18 +243,23 @@
Loading
243 243
  }
244 244
245 245
  final_model <- lm(paste(response, "~", paste(preds, collapse = " + ")), data = l)
246 +
  
247 +
  metrics     <- data.frame(r2 = rsq[step], adj_r2 = adjrsq[step], aic = aic[step], 
248 +
                            sbic = sbic[step], sbc = sbc[step], mallows_cp = cp[step], 
249 +
                            rmse = rmse[step])
246 250
247 -
  out <- list(predictors = preds,
248 -
              mallows_cp = cp,
251 +
  out <- list(adjr       = adjrsq,
252 +
              aic        = aic,
249 253
              indvar     = cterms,
250 -
              rsquare    = rsq,
251 -
              steps      = step,
252 -
              sbic       = sbic,
253 -
              adjr       = adjrsq,
254 +
              mallows_cp = cp,
255 +
              metrics    = metrics,
256 +
              model      = final_model,
257 +
              predictors = preds,
254 258
              rmse       = rmse,
255 -
              aic        = aic,
259 +
              rsquare    = rsq,
256 260
              sbc        = sbc,
257 -
              model      = final_model)
261 +
              sbic       = sbic,
262 +
              steps      = step)
258 263
259 264
  class(out) <- "ols_step_forward_p"
260 265
Files Coverage
R 92.82%
src 100.00%
Project Totals (52 files) 92.84%
Notifications are pending CI completion. Waiting for GitHub's status webhook to queue notifications. Push notifications now.
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
        informational: true
10
    patch:
11
      default:
12
        target: auto
13
        threshold: 1%
14
        informational: true
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading