-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path51-App-Tables.Rmd
More file actions
135 lines (99 loc) · 4.49 KB
/
51-App-Tables.Rmd
File metadata and controls
135 lines (99 loc) · 4.49 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# $z$-score tables {#Tables}
\index{Normal distribution!tables|(}
<!-- APPENDIX B: Table -->
<!-- Different forwards-z tables pointers for ONLINE and PDF: -->
<!-- * ONLINE: Only have *one* link to the forward tables -->
<!-- * PDF: Have *two* links to the forward tables: Negative and positive z-values -->
<!-- Different backwards z-table pointers for ONLINE and PDF: -->
<!-- * ONLINE: Point to the backwards-z tables -->
<!-- * PDF: NO pointer, as we just use the forward-tables -->
<!-- Define colours as appropriate -->
```{r, child = if (knitr::is_html_output()) {'./children/coloursHTML.Rmd'} else {'./children/coloursLaTeX.Rmd'}}
```
This appendix contains $z$-score tables.
<!-- * Random numbers (Appendix\ \@ref(AppendixRandomNumbers)). -->
These tables provide the area *to the left* of a given $z$-score associated with a normal
<!-- HTML: One set of tables only is needed -->
<!-- PDF: Two set of tables: NEG and POS z-scores -->
`r if (knitr::is_html_output()){
'distribution (Appendix\\ \\@ref(ZTablesOnline)),'
} else {
'distribution: Appendices\\ \\@ref(ZTablesNEG) (for negative values of\ $z$) and\\ \\@ref(ZTablesPOS) (for positive values of\ $z$).'
}`
<!-- Only for online: PDF uses forward tables -->
`r if (knitr::is_html_output()){
' or the $z$-score such that a given area is to the left (Appendix\\ \\@ref(ZTablesOnlineBackwardsHTML)).'
}`
`r if (knitr::is_latex_output()) {
'The online version of this book (https://peterkdunn.github.io/SRM-Textbook/)'
} else {
'The [online version of this book](https://peterkdunn.github.io/SRM-Textbook/AppendixDataSets.html) '
}`
has online tables, which are easier to use.
```{r, child = if (knitr::is_latex_output()) './Tables/Ztables-Using-Hardcopy-Appendix.Rmd'}
```
\pagebreak
<!-- ## Random numbers {#AppendixRandomNumbers} -->
<!-- ```{r} -->
<!-- num.rows <- 26 -->
<!-- num.cols <- 5 -->
<!-- numbers.per.cell <- 5 -->
<!-- total.numbers <- num.rows * num.cols * numbers.per.cell -->
<!-- random.numbers <- sample(0:9, -->
<!-- total.numbers, -->
<!-- replace = TRUE) -->
<!-- rn.array <- array(random.numbers, -->
<!-- dim = c(num.rows, num.cols) ) -->
<!-- rownames(rn.array) <- paste( "Row", -->
<!-- LETTERS) -->
<!-- colnames(rn.array) <- paste("Column", -->
<!-- c("I","II","III","IV","V") ) -->
<!-- for (i in (1 : num.rows)){ -->
<!-- for (j in (1 : num.cols)){ -->
<!-- rn.array[i,j] <- paste( paste0("$", -->
<!-- sample(0:9, -->
<!-- size = numbers.per.cell, -->
<!-- replace = TRUE), -->
<!-- "$"), -->
<!-- collapse = " " ) -->
<!-- } -->
<!-- } -->
<!-- if( knitr::is_latex_output() ) { -->
<!-- knitr::kable(surroundMaths(rn.array), -->
<!-- format = "latex", -->
<!-- longtable = FALSE, -->
<!-- escape = FALSE, -->
<!-- #caption = "Some random numbers", -->
<!-- booktabs = TRUE) %>% -->
<!-- kable_styling(font_size = 9) %>% -->
<!-- row_spec(0, bold = TRUE) -->
<!-- } -->
<!-- if( knitr::is_html_output() ) { -->
<!-- knitr::kable(rn.array, -->
<!-- format = "html", -->
<!-- longtable = FALSE, -->
<!-- escape = FALSE, -->
<!-- #caption = "Some random numbers", -->
<!-- booktabs = TRUE) %>% -->
<!-- row_spec(row = 0, -->
<!-- bold = TRUE) -->
<!-- } -->
<!-- ``` -->
<!-- ********* LaTeX *********** -->
<!-- The LaTeX files: Only forwards tables, in two bits (positive z and negative z) -->
<!-- Forward and Backward LaTeX tables -->
```{r, child = if (knitr::is_latex_output()) './Tables/Ztables-LaTeX.Rmd'}
```
<!-- ********* HTML *********** -->
<!-- The HTML tables (plus instructions) -->
<!-- Forward (z to Area) tables -->
```{r, child = if (knitr::is_html_output()) './Tables/Ztables-Online.Rmd'}
```
```{r, child = if (knitr::is_html_output()) './Tables/Ztables-Using-Online-Instructions.Rmd'}
```
<!-- The above HTML tables also includes backwards (Area to z) tables (NOT LATEX) -->
```{r, child = if (knitr::is_html_output() ) './Tables/Ztables-Backwards-Online.Rmd' }
```
```{r, child = if (knitr::is_html_output() ) './Tables/Ztables-Backwards-Using-Online-Instructions.Rmd'}
```
\index{Normal distribution!tables|)}