Showing 7 of 31 files from the diff.

@@ -80,10 +80,10 @@
Loading
80 80
#' Z <- b0 + b1 * X1 + b2 * X2
81 81
#' pr <- 1 / (1 + exp(-Z)) # inv logit function
82 82
#' Y <- rbinom(n, 1, pr)
83 -
#' data <- data.frame(cbind(X1, X2, Y))
83 +
#' df <- data.frame(cbind(X1, X2, Y))
84 84
#' 
85 85
#' ## formatting the data for jags
86 -
#' datjags <- as.list(data)
86 +
#' datjags <- as.list(df)
87 87
#' datjags$N <- length(datjags$Y)
88 88
#' 
89 89
#' ## creating jags model
@@ -122,7 +122,8 @@
Loading
122 122
#' ## generating regression table with only betas and custom coefficent names
123 123
#' mcmcReg(fit, pars = c('b'), coefnames = c('Variable 1',
124 124
#'                                           'Variable 2',
125 -
#'                                           'Variable 3'))
125 +
#'                                           'Variable 3'),
126 +
#'         regex = TRUE)
126 127
#' ## generating regression tables with all betas and custom names
127 128
#' mcmcReg(fit, coefnames = c('Variable 1', 'Variable 2',
128 129
#'                            'Variable 3', 'deviance'))

@@ -68,10 +68,10 @@
Loading
68 68
#'   Z <- b0 + b1 * X1 + b2 * X2
69 69
#'   pr <- 1 / (1 + exp(-Z)) # inv logit function
70 70
#'   Y <- rbinom(n, 1, pr) 
71 -
#'   data <- data.frame(cbind(X1, X2, Y))
71 +
#'   df <- data.frame(cbind(X1, X2, Y))
72 72
#'   
73 73
#'   ## formatting the data for jags
74 -
#'   datjags <- as.list(data)
74 +
#'   datjags <- as.list(df)
75 75
#'   datjags$N <- length(datjags$Y)
76 76
#'   
77 77
#'   ## creating jags model
@@ -105,7 +105,7 @@
Loading
105 105
#' 
106 106
#' ### average value approach
107 107
#' library(coda)
108 -
#' xmat <- model.matrix(Y ~ X1 + X2, data = data)
108 +
#' xmat <- model.matrix(Y ~ X1 + X2, data = df)
109 109
#' mcmc <- as.mcmc(fit)
110 110
#' mcmc_mat <- as.matrix(mcmc)[, 1:ncol(xmat)]
111 111
#' X1_sim <- seq(from = min(datjags$X1),

@@ -43,10 +43,10 @@
Loading
43 43
#'
44 44
#' ## linear model data
45 45
#' Y_linear <- rnorm(n, Z, 1)
46 -
#' data <- data.frame(cbind(X1, X2, Y = Y_linear))
46 +
#' df <- data.frame(cbind(X1, X2, Y = Y_linear))
47 47
#' 
48 48
#' ## formatting the data for jags
49 -
#' datjags <- as.list(data)
49 +
#' datjags <- as.list(df)
50 50
#' datjags$N <- length(datjags$Y)
51 51
#' 
52 52
#' ## creating jags model

@@ -67,10 +67,10 @@
Loading
67 67
#'   Z <- b0 + b1 * X1 + b2 * X2
68 68
#'   pr <- 1 / (1 + exp(-Z)) # inv logit function
69 69
#'   Y <- rbinom(n, 1, pr) 
70 -
#'   data <- data.frame(cbind(X1, X2, Y))
70 +
#'   df <- data.frame(cbind(X1, X2, Y))
71 71
#'   
72 72
#'   ## formatting the data for jags
73 -
#'   datjags <- as.list(data)
73 +
#'   datjags <- as.list(df)
74 74
#'   datjags$N <- length(datjags$Y)
75 75
#'   
76 76
#'   ## creating jags model
@@ -104,7 +104,7 @@
Loading
104 104
#' 
105 105
#' ### observed value approach
106 106
#' library(coda)
107 -
#' xmat <- model.matrix(Y ~ X1 + X2, data = data)
107 +
#' xmat <- model.matrix(Y ~ X1 + X2, data = df)
108 108
#' mcmc <- as.mcmc(fit)
109 109
#' mcmc_mat <- as.matrix(mcmc)[, 1:ncol(xmat)]
110 110
#' X1_sim <- seq(from = min(datjags$X1),

@@ -67,10 +67,10 @@
Loading
67 67
#' Z <- b0 + b1 * X1 + b2 * X2
68 68
#' pr <- 1 / (1 + exp(-Z)) # inv logit function
69 69
#' Y <- rbinom(n, 1, pr) 
70 -
#' data <- data.frame(cbind(X1, X2, Y))
70 +
#' df <- data.frame(cbind(X1, X2, Y))
71 71
#' 
72 72
#' ## formatting the data for jags
73 -
#' datjags <- as.list(data)
73 +
#' datjags <- as.list(df)
74 74
#' datjags$N <- length(datjags$Y)
75 75
#' 
76 76
#' ## creating jags model
@@ -102,7 +102,7 @@
Loading
102 102
#'                     n.burnin = 1000, model.file = model)
103 103
#' 
104 104
#' ## running function with logit
105 -
#' xmat <- model.matrix(Y ~ X1 + X2, data = data)
105 +
#' xmat <- model.matrix(Y ~ X1 + X2, data = df)
106 106
#' mcmc <- coda::as.mcmc(fit)
107 107
#' mcmc_mat <- as.matrix(mcmc)[, 1:ncol(xmat)]
108 108
#' object <- mcmcFD(modelmatrix = xmat,
@@ -234,10 +234,10 @@
Loading
234 234
#' Z <- b0 + b1 * X1 + b2 * X2
235 235
#' pr <- 1 / (1 + exp(-Z)) # inv logit function
236 236
#' Y <- rbinom(n, 1, pr) 
237 -
#' data <- data.frame(cbind(X1, X2, Y))
237 +
#' df <- data.frame(cbind(X1, X2, Y))
238 238
#' 
239 239
#' ## formatting the data for jags
240 -
#' datjags <- as.list(data)
240 +
#' datjags <- as.list(df)
241 241
#' datjags$N <- length(datjags$Y)
242 242
#' 
243 243
#' ## creating jags model
@@ -269,7 +269,7 @@
Loading
269 269
#'                     n.burnin = 1000, model.file = model)
270 270
#' 
271 271
#' ## preparing data for mcmcFD()
272 -
#' xmat <- model.matrix(Y ~ X1 + X2, data = data)
272 +
#' xmat <- model.matrix(Y ~ X1 + X2, data = df)
273 273
#' mcmc <- coda::as.mcmc(fit)
274 274
#' mcmc_mat <- as.matrix(mcmc)[, 1:ncol(xmat)]
275 275
#' 
@@ -409,10 +409,10 @@
Loading
409 409
#' Z <- b0 + b1 * X1 + b2 * X2
410 410
#' pr <- 1 / (1 + exp(-Z)) # inv logit function
411 411
#' Y <- rbinom(n, 1, pr) 
412 -
#' data <- data.frame(cbind(X1, X2, Y))
412 +
#' df <- data.frame(cbind(X1, X2, Y))
413 413
#' 
414 414
#' ## formatting the data for jags
415 -
#' datjags <- as.list(data)
415 +
#' datjags <- as.list(df)
416 416
#' datjags$N <- length(datjags$Y)
417 417
#' 
418 418
#' ## creating jags model
@@ -444,7 +444,7 @@
Loading
444 444
#'                     n.burnin = 1000, model.file = model)
445 445
#' 
446 446
#' ## preparing data for mcmcFD()
447 -
#' xmat <- model.matrix(Y ~ X1 + X2, data = data)
447 +
#' xmat <- model.matrix(Y ~ X1 + X2, data = df)
448 448
#' mcmc <- coda::as.mcmc(fit)
449 449
#' mcmc_mat <- as.matrix(mcmc)[, 1:ncol(xmat)]
450 450
#' 
@@ -452,7 +452,8 @@
Loading
452 452
#' full <- mcmcFD(modelmatrix = xmat,
453 453
#'                mcmcout = mcmc_mat,
454 454
#'                fullsims = TRUE)
455 -
#' mcmcFDplot(full)
455 +
#' # suppress deprecated warning for R check
456 +
#' suppressWarnings(mcmcFDplot(full))
456 457
#' 
457 458
#' }
458 459
#' 

@@ -44,10 +44,10 @@
Loading
44 44
#' Z <- b0 + b1 * X1 + b2 * X2
45 45
#' pr <- 1 / (1 + exp(-Z)) # inv logit function
46 46
#' Y <- rbinom(n, 1, pr)
47 -
#' data <- data.frame(cbind(X1, X2, Y))
47 +
#' df <- data.frame(cbind(X1, X2, Y))
48 48
#' 
49 49
#' ## formatting the data for jags
50 -
#' datjags <- as.list(data)
50 +
#' datjags <- as.list(df)
51 51
#' datjags$N <- length(datjags$Y)
52 52
#' 
53 53
#' ## creating jags model

@@ -53,10 +53,10 @@
Loading
53 53
#' Z <- b0 + b1 * X1 + b2 * X2
54 54
#' pr <- 1 / (1 + exp(-Z)) # inv logit function
55 55
#' Y <- rbinom(n, 1, pr) 
56 -
#' data <- data.frame(cbind(X1, X2, Y))
56 +
#' df <- data.frame(cbind(X1, X2, Y))
57 57
#' 
58 58
#' # formatting the data for jags
59 -
#' datjags <- as.list(data)
59 +
#' datjags <- as.list(df)
60 60
#' datjags$N <- length(datjags$Y)
61 61
#' 
62 62
#' # creating jags model
@@ -88,8 +88,8 @@
Loading
88 88
#'                     n.burnin = 1000, model.file = model)
89 89
#' 
90 90
#' # processing the data
91 -
#' mm <- model.matrix(Y ~ X1 + X2, data = data)
92 -
#' xframe <- as.matrix(model.frame(Y ~ X1 + X2, data = data))
91 +
#' mm <- model.matrix(Y ~ X1 + X2, data = df)
92 +
#' xframe <- as.matrix(model.frame(Y ~ X1 + X2, data = df))
93 93
#' mcmc <- coda::as.mcmc(fit)
94 94
#' mcmc_mat <- as.matrix(mcmc)[, 1:ncol(xframe)]
95 95
#' 
Files Coverage
R 77.64%
Project Totals (10 files) 77.64%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
    patch:
10
      default:
11
        target: auto
12
        threshold: 1%
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