Totalt fångade: 918
- Kanto: 151 / 151
- Johto: 100 / 100
| age | mu | sigma | distribution | curve_type | sex | |
|---|---|---|---|---|---|---|
| 0 | 2.57100554377099 | 0.0922583524150075 | lognormal | BMI | Female | |
| 0.0192307692307692 | 2.57844421854704 | 0.0930266849047542 | lognormal | BMI | Female | |
| 0.0384615384615385 | 2.58582277140139 | 0.0937837167854261 | lognormal | BMI | Female | |
| 0.0576923076923077 | 2.59419062860573 | 0.0941802383921422 | lognormal | BMI | Female | |
| 0.0769230769230769 | 2.60217987485774 | 0.0952743181250675 | lognormal | BMI | Female | |
| 0.0961538461538462 | 2.60941889949846 | 0.0966360442765681 | lognormal | BMI | Female | |
| 0.115384615384615 | 2.61579707885172 | 0.097138359277102 | lognormal | BMI | Female | |
| 0.134615384615385 | 2.62219035132633 | 0.0976699812233934 | lognormal | BMI | Female | |
| 0.153846153846154 | 2.62858029640738 | 0.0982248149897653 | lognormal | BMI | Female |
| pacman::p_load(pacman, tidyverse, rio, magrittr, janitor, ggdist, distributional) | |
| tibble::tribble( | |
| ~Kön, ~Ålder, ~Kapital.Medel, ~Kapital.Median, ~Månadssparande.Medel, ~Månadssparande.Median, | |
| "Kvinna", 18L, 66660L, 10750L, 2440L, 550L, | |
| "Kvinna", 19L, 66510L, 12810L, 4570L, 1700L, | |
| "Kvinna", 20L, 71230L, 17110L, 4730L, 2000L, | |
| "Kvinna", 21L, 72470L, 16100L, 4110L, 1500L, | |
| "Kvinna", 22L, 71510L, 15910L, 3710L, 1400L, | |
| "Kvinna", 23L, 78860L, 16720L, 3590L, 1500L, | |
| "Kvinna", 24L, 78820L, 16570L, 3750L, 1500L, |
| #' Calculate Relative Measurement Uncertainty (RMU) from an rvar | |
| #' | |
| #' This function takes a vector of `rvar`s (one for each subject) and estimates | |
| #' the reliability of the posteriors using the Relative Measurement Uncertainty (RMU) | |
| #' method, as described by Bignardi et al. (2024). It is designed to be robust | |
| #' to the common case where the underlying array of a vector rvar from a model | |
| #' has a trailing dimension of 1 (e.g., [draws, subjects, 1]). | |
| #' | |
| #' @param intercepts_rvar A vector `rvar` object from the `posterior` package. | |
| #' Each element of the vector represents the posterior distribution for a |
| pacman::p_load(pacman, tidyverse, rio, magrittr, janitor, ggdist, distributional) | |
| tibble::tribble( | |
| ~Kön, ~Ålder, ~Kapital.Medel, ~Kapital.Median, ~Månadssparande.Medel, ~Månadssparande.Median, | |
| "Kvinna", 18L, 66660L, 10750L, 2440L, 550L, | |
| "Kvinna", 19L, 66510L, 12810L, 4570L, 1700L, | |
| "Kvinna", 20L, 71230L, 17110L, 4730L, 2000L, | |
| "Kvinna", 21L, 72470L, 16100L, 4110L, 1500L, | |
| "Kvinna", 22L, 71510L, 15910L, 3710L, 1400L, | |
| "Kvinna", 23L, 78860L, 16720L, 3590L, 1500L, | |
| "Kvinna", 24L, 78820L, 16570L, 3750L, 1500L, |
| <!DOCTYPE html> | |
| <!-- Vibe coded with Gemini 2.5 Pro --> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Interactive Confusion Matrix</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <style> | |
| body { |
| atc,sv1,sv2,sv3,sv4,sv5 | |
| A,Matsmältningsorgan och ämnesomsättning,,,, | |
| A01,Matsmältningsorgan och ämnesomsättning,Medel vid mun- och tandsjukdomar,,, | |
| A01A,Matsmältningsorgan och ämnesomsättning,Medel vid mun- och tandsjukdomar,Medel vid mun- och tandsjukdomar,, | |
| A01AA,Matsmältningsorgan och ämnesomsättning,Medel vid mun- och tandsjukdomar,Medel vid mun- och tandsjukdomar,Medel mot karies, | |
| A01AA01,Matsmältningsorgan och ämnesomsättning,Medel vid mun- och tandsjukdomar,Medel vid mun- och tandsjukdomar,Medel mot karies,Natriumfluorid | |
| A01AA02,Matsmältningsorgan och ämnesomsättning,Medel vid mun- och tandsjukdomar,Medel vid mun- och tandsjukdomar,Medel mot karies,Natriummonofluorofosfat | |
| A01AA03,Matsmältningsorgan och ämnesomsättning,Medel vid mun- och tandsjukdomar,Medel vid mun- och tandsjukdomar,Medel mot karies,Olaflur | |
| A01AA04,Matsmältningsorgan och ämnesomsättning,Medel vid mun- och tandsjukdomar,Medel vid mun- och tandsjukdomar,Medel mot karies,Tennfluorid | |
| A01AA30,Matsmältningsorgan och ämnesomsättning,Medel vid |
| # Third order Delta method | |
| bias_adj <- function(mu, sigma, fun){ | |
| first_deriv <- pracma::fderiv(fun, mu) | |
| second_deriv <- pracma::fderiv(fun, mu, n = 2) | |
| third_deriv <- pracma::fderiv(fun, mu, n = 3) | |
| moment1 <- fun(mu)+ # first order | |
| 1/2*second_deriv*sigma^2 # second order | |
| # the third order part evaluates to zero due to symmetry | |
| moment2 <- sqrt((first_deriv*sigma)^2+ # first order |
| # Workaround for Chromium Issue 468227 - fixes download functionality in Chrome-based browsers | |
| downloadButton <- function(...) { | |
| tag <- shiny::downloadButton(...) | |
| tag$attribs$download <- NULL | |
| tag | |
| } | |
| # Load required packages | |
| library(shiny) # Core Shiny functionality | |
| library(DT) # For interactive data tables |
| library(shiny) | |
| library(bslib) | |
| library(readxl) | |
| library(FactoMineR) | |
| library(factoextra) | |
| library(DT) | |
| library(dplyr) | |
| library(data.table) | |
| ui <- page_sidebar( |