Skip to content

Commit

Permalink
add: chi2 for goodness of fit
Browse files Browse the repository at this point in the history
  • Loading branch information
tin900 committed Aug 15, 2023
1 parent 7575938 commit 794457f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion R/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,23 @@ app_server <- function(input, output, session) {
result
})
} else if (input$statistical_test == "Chi-kwadraat toets voor goodness of fit en binomiaaltoets") {
## Retrieve the data from input
data <- data()

## Retrieve the input value for dependent_var
dependent_var <- input$dependent_var

## Create a table with the counts of students with and without hbo vooropleiding
table_var <- table(data[[dependent_var]])

## Calculate the expected frequencies
## hardcoded mu is mean(data()), but not for this case
result <- stats::chisq.test(table_var, p = c(0.1113, 1 - 0.1113))
#
# Perform the Chi-kwadraat toets voor goodness of fit en binomiaaltoets
# ...
output$test_report <- shiny::renderPrint({
result
})
} else if (input$statistical_test == "McNemar toets") {
# Perform the McNemar toets
## Retrieve the data from input
Expand Down

0 comments on commit 794457f

Please sign in to comment.