Skip to content

Commit 2ef17b6

Browse files
committed
rounding errors
1 parent fbdf069 commit 2ef17b6

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

Cohort-modeling-tutorial.Rproj

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
Version: 1.0
2-
3-
RestoreWorkspace: Default
4-
SaveWorkspace: Default
5-
AlwaysSaveHistory: Default
6-
7-
EnableCodeIndexing: Yes
8-
UseSpacesForTab: Yes
9-
NumSpacesForTab: 2
10-
Encoding: UTF-8
11-
12-
RnwWeave: knitr
13-
LaTeX: pdfLaTeX
1+
Version: 1.0
2+
3+
RestoreWorkspace: Default
4+
SaveWorkspace: Default
5+
AlwaysSaveHistory: Default
6+
7+
EnableCodeIndexing: Yes
8+
UseSpacesForTab: Yes
9+
NumSpacesForTab: 2
10+
Encoding: UTF-8
11+
12+
RnwWeave: knitr
13+
LaTeX: pdfLaTeX

analysis/STM_01.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ m_P["S2", "S2"] <- 1 - p_S2D
157157
m_P["S2", "D"] <- p_S2D
158158
# From D
159159
m_P["D", "D"] <- 1
160+
# Round to 6 digits to avoid floating errors
161+
m_P <- round(m_P, 6)
160162

161163
### For strategies B and AB
162164
## Initialize transition probability array for strategies B and AB

0 commit comments

Comments
 (0)