Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
sbalci committed Dec 2, 2023
1 parent fb96834 commit ddeb852
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 72 deletions.
12 changes: 6 additions & 6 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
.jmo$
^build/R/
^build/js/
^tododata/
/tododata/
tododata
^_tododata/
/_tododata/
_tododata
^vignettes/
^docs/
^temp/
Expand Down Expand Up @@ -81,7 +81,7 @@ modellingSurvival\\.


ClinicoPath.code-workspace
others
_others
pdfs

^module-updates.R$
Expand All @@ -106,9 +106,9 @@ docs_pkgdown
module-updates-jjstatsplot.R
module-updates.R
NEWS.md
others
_others
pdfs
tododata
_tododata
vignettes

meddecide
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ po/*~
.Rhistory
.RData
.Ruserdata
others
_others
build
*.jmo
.DS_Store
ClinicoPath.code-workspace
docs
pdfs
temp
tododata
_tododata
^docs$
65 changes: 35 additions & 30 deletions R/oddsratio.b.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ oddsratioClass <- if (requireNamespace('jmvcore')) R6::R6Class(
<br><br>
Outcome variable should be coded binary, defining whether the patient is dead or event (recurrence) occured
or censored (patient is alive or free of disease) at the last visit.
<br><br>
Variable names with empty spaces or special characters may not work properly. Consider renaming them.
<br><br>
This function uses finalfit package. Please cite jamovi and the packages as given below.
<br><br>
Expand Down Expand Up @@ -147,62 +149,65 @@ oddsratioClass <- if (requireNamespace('jmvcore')) R6::R6Class(

# formulaR3 <- as.vector(self$options$outcome)

# formulaL <- jmvcore::composeTerms(listOfComponents =
# self$options$explanatory)

# formulaR <- jmvcore::toNumeric(formulaR)
# formulaL <- as.vector(formulaL)


# results1 <- list(
# formulaR,
# formula2
# )
#
# self$results$text$setContent(results1)
# formula2 <- jmvcore::constructFormula(terms = formulaL)

# formulaL2 <- jmvcore::constructFormula(terms =
# self$options$explanatory)

# formulaR <- jmvcore::toNumeric(formulaR)


# glm(depdendent ~ explanatory, family="binomial")

finalfit::finalfit(.data = mydata,
dependent = formulaR3,
dependent = formulaR,
explanatory = formula2,
metrics = TRUE
) -> tOdds


# self$results$textmydata$setContent(
# list(
# outcomeLevel,
# outcome_name,
# outcome1,
# mydata,
# formula2,
# formulaR,
# # formulaR2,
# # outcomeLevel,
# # outcome_name,
# # outcome1,
# head = head(mydata),
# formula2 = formula2,
# formulaR = formulaR,
# formulaL = formulaL,
# formulaL2 = formulaL2,
# # formulaR3,
# names(mydata)
# names_dara = names(mydata)
# # ,
# # tOdds
# )
# )


# text2 <- glue::glue("
# <br>
# <b>Model Metrics:</b>
# ",
# unlist(
# tOdds[[2]]
# ),
# "
# <br>
# ")
text2 <- glue::glue("
<br>
<b>Model Metrics:</b>
",
unlist(
tOdds[[2]]
),
"
<br>
")


self$results$text2$setContent(text2)


results1 <- knitr::kable(tOdds[[1]],
row.names=FALSE,
align=c("l", "l", "r", "r", "r", "r"),
row.names = FALSE,
align = c("l", "l", "r", "r", "r", "r"),
format = "html")
self$results$text$setContent(results1)

Expand Down
3 changes: 1 addition & 2 deletions man/oddsratio.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ddeb852

Please sign in to comment.