File: methods_logistf.R

package info (click to toggle)
r-cran-parameters 0.24.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,852 kB
  • sloc: sh: 16; makefile: 2
file content (61 lines) | stat: -rw-r--r-- 1,111 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# model_parameters --------------------

#' @export
model_parameters.logistf <- model_parameters.glm

#' @export
model_parameters.flic <- model_parameters.glm

#' @export
model_parameters.flac <- model_parameters.glm


# ci --------------------

#' @export
ci.logistf <- ci.glm

#' @export
ci.flic <- ci.glm

#' @export
ci.flac <- ci.glm


# SE --------------------

#' @export
standard_error.logistf <- function(model, ...) {
  vc <- insight::get_varcov(model, ...)
  se <- sqrt(diag(vc))

  .data_frame(
    Parameter = .remove_backticks_from_string(names(se)),
    SE = as.vector(se)
  )
}

#' @export
standard_error.flic <- standard_error.logistf

#' @export
standard_error.flac <- standard_error.logistf


# p --------------------

#' @export
p_value.logistf <- function(model, ...) {
  utils::capture.output(s <- summary(model)) # nolint

  .data_frame(
    Parameter = .remove_backticks_from_string(names(s$coefficients)),
    p = as.vector(s$prob)
  )
}

#' @export
p_value.flic <- p_value.logistf

#' @export
p_value.flac <- p_value.logistf