mswhite commited on
Commit
2be14aa
·
verified ·
1 Parent(s): 33e3faa

Delete pages

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. pages/Bonus.py +0 -26
  2. pages/Module_01.py +0 -26
  3. pages/Module_02.py +0 -26
  4. pages/Module_03.py +0 -26
  5. pages/Module_04.py +0 -26
  6. pages/Module_05.py +0 -26
  7. pages/Module_06.py +0 -26
  8. pages/Module_07.py +0 -26
  9. pages/Module_08.py +0 -26
  10. pages/Module_09.py +0 -26
  11. pages/Module_10.py +0 -26
  12. pages/Module_11.py +0 -26
  13. pages/Module_12.py +0 -26
  14. pages/Module_13.py +0 -26
  15. pages/Module_14.py +0 -26
  16. pages/Module_15.py +0 -26
  17. pages/Module_16.py +0 -26
  18. pages/Module_17.py +0 -26
  19. pages/Module_18.py +0 -26
  20. pages/Module_19.py +0 -26
  21. pages/Module_20.py +0 -26
  22. pages/Overview.py +0 -26
  23. pages/__init__.py +0 -14
  24. pages/__pycache__/__init__.cpython-312.pyc +0 -0
  25. pages/__pycache__/load_pages.cpython-312.pyc +0 -0
  26. pages/assets/formulas.txt +0 -221
  27. pages/assets/logo.jpg +0 -0
  28. pages/assets/profile.txt +0 -17
  29. pages/assets/progress.txt +0 -43
  30. pages/load_pages.py +0 -473
  31. pages/modules/Bonus/Overview - Backup.txt +0 -43
  32. pages/modules/Bonus/Overview.txt +0 -108
  33. pages/modules/Bonus/astro_checkpoint.jpg +0 -0
  34. pages/modules/Bonus/astro_thumbsup.jpg +0 -0
  35. pages/modules/Bonus/checkpoint_banner - backup.jpg +0 -3
  36. pages/modules/Bonus/checkpoint_banner.jpg +0 -0
  37. pages/modules/Bonus/flashcards - Copy.html +0 -182
  38. pages/modules/Bonus/flashcards.html +0 -180
  39. pages/modules/Bonus/navigational_map.html +0 -176
  40. pages/modules/Bonus/solar_movie_crop.mp4 +0 -3
  41. pages/modules/Copy_Overview.bat +0 -21
  42. pages/modules/Module_01/Inference Error Types.txt +0 -24
  43. pages/modules/Module_01/Overview.txt +0 -175
  44. pages/modules/Module_01/astro_unicorn.jpg +0 -3
  45. pages/modules/Module_01/blastoff.jpg +0 -3
  46. pages/modules/Module_01/checkpoint_banner.jpg +0 -0
  47. pages/modules/Module_01/dice_sim.html +0 -175
  48. pages/modules/Module_01/flashcards01.html +0 -165
  49. pages/modules/Module_02/Overview.txt +0 -122
  50. pages/modules/Module_02/astro_float.jpg +0 -0
pages/Bonus.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Bonus"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_01.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_01"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_02.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_02"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_03.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_03"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_04.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_04"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_05.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_05"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_06.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_06"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_07.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_07"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_08.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_08"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_09.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_09"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_10.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_10"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_11.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_11"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_12.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_11"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_13.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_11"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_14.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_11"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_15.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_11"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_16.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_11"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_17.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_11"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_18.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_11"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_19.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_11"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Module_20.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Module_11"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/Overview.py DELETED
@@ -1,26 +0,0 @@
1
- CURRENT_MODULE = "Overview"
2
-
3
- # Imports
4
-
5
- import streamlit as st
6
- import streamlit.components.v1 as components
7
- from pages import load_pages
8
-
9
- if "logged_in" not in st.session_state:
10
- pass
11
- else:
12
- load_pages.load_page(CURRENT_MODULE)
13
-
14
- if __name__ == "__main__":
15
- load_pages.test_load()
16
- print("<<< Module [", CURRENT_MODULE, "] Compile Successful >>>")
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/__init__.py DELETED
@@ -1,14 +0,0 @@
1
-
2
- if __name__ == "__main__":
3
- print("<<< __init__ Compile Successful >>>")
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (269 Bytes)
 
pages/__pycache__/load_pages.cpython-312.pyc DELETED
Binary file (21.6 kB)
 
pages/assets/formulas.txt DELETED
@@ -1,221 +0,0 @@
1
- Expander: Null Hypothesis
2
- **The “no‐effect” or “no‐difference” assumption**
3
-
4
- Mathematical Notation:
5
- H₀: θ = θ₀ (e.g. H₀: μ = 0)
6
-
7
- *Example (one‐sample t‐test against μ₀ = 5):*
8
- *x = c(5.1, 4.9, 5.0, 5.2)*
9
- *t.test(x, mu = 5)*
10
- End Expander:
11
- Expander: Alternative Hypothesis
12
- **The different claim you wish to support**
13
-
14
- Mathematical Notation:
15
- – Two‐sided: Hₐ: θ ≠ θ₀
16
- – One‐sided: Hₐ: θ > θ₀ or Hₐ: θ < θ₀
17
-
18
- *Example (test if mean > 5):*
19
- *t.test(x, mu = 5, alternative = "greater")*
20
- *or alternative = "two.sided" (default), "greater" or "less"*
21
- End Expander:
22
- Expander: p-value
23
- **Assuming H₀ is true, this is the probability of seeing data**
24
- **in your statistical test that is at least as extreme as yours**
25
-
26
- Mathematical Notation:
27
- p = P(Test statistic ≥ observed | H₀) (one‐tailed)
28
- p = 2·P(|Test statistic| ≥ |observed| | H₀) (two‐tailed)
29
-
30
- R function:
31
- returned by many tests as $p.value
32
-
33
- *Example (from t.test above):*
34
- *res = t.test(x, mu = 5)*
35
- *res$p.value*
36
- End Expander:
37
- Expander: Confidence Interval
38
- A range of plausible values for the parameter calculated so that
39
- e.g. 95% of such intervals (in repeated sampling) contain the true value
40
- Mathematical form & notation:
41
- CI₁₋α = [θ̂ ± z₁₋α/₂·SE(θ̂)] for normal distribution
42
- CI₁₋α = [θ̂ ± t_{n–1,1–α/₂}·SE(θ̂)] for an unknown σ
43
-
44
- *Example (95% CI for mean):*
45
- *t.test(x, conf.level = 0.95)$conf.int*
46
- End Expander:
47
- Expander: Significance Level (α)
48
- **The cutoff probability for a rare result under H₀**
49
- **if p ≤ α you reject H₀**
50
-
51
- Mathematical Notation:
52
- α = P(Type I error)
53
- = P(reject H₀ | H₀ true)
54
-
55
- R function:
56
- you compare to see if p.value ≤ α
57
- and conf.level = 1–α
58
- End Expander:
59
- Expander: One-tailed test
60
- **A test that looks for an effect in only one direction (greater or less)**
61
-
62
- Mathematical Notation:
63
- Hₐ: θ > θ₀ or Hₐ: θ < θ₀
64
-
65
- R function:
66
- alternative = "greater" or "less"
67
-
68
- *Example:*
69
- *t.test(x, mu = 5, alternative = "less")*
70
- End Expander:
71
- Expander: Two-tailed Test
72
- **A test that looks for an effect in either direction**
73
-
74
- Mathematical Notation:
75
- Hₐ: θ ≠ θ₀
76
-
77
- R function:
78
- alternative = "two.sided" (default)
79
-
80
- *Example:*
81
- *t.test(x, mu = 5, alternative = "two.sided")*
82
- End Expander:
83
- Expander: Normal Distribution
84
- **The symmetric bell‐shaped distribution**
85
- Many statistical curves “look normal” when the sample size is large
86
-
87
- Mathematical Notation:
88
- X ~ N(μ, σ²)
89
- The amount of area under the normal curve when 2 standard deviations
90
- away to the right is written as P(Z ≤ 2.0) = 97.72% of the curve
91
-
92
- R functions:
93
- – dnorm(x, mean, sd) density
94
- – pnorm(q, mean, sd) pdf
95
- – qnorm(p, mean, sd) inverse of pnorm
96
- – rnorm(n, mean, sd) n random samples
97
-
98
- *Example:*
99
- *pnorm(2.0, mean = 0, sd = 1) # = 97.72%*
100
- *qnorm(0.9772, mean = 0, sd = 1) # = 2.0 = inverse of p*
101
- End Expander:
102
- Expander: False Positive (Type I Error)
103
- **Rejecting H₀ when it is actually true**
104
- *e.g. Unicorns do not exist but the statistical test said they did*
105
- *when the null hypothesis (H₀) or base assumption is unicorns do not exist*
106
- Mathematical Notation:
107
- P(Type I error) = α
108
- End Expander:
109
- Expander: False Negative (Type II error)
110
- **Failing to reject H₀ when it is actually false**
111
- *e.g. Unicorns exist but the statistical test said they do not*
112
- *when the null hypothesis (H₀) or base assumption is unicorns do not exist*
113
- Also called Beta(β)
114
-
115
- Mathematical Notation:
116
- β = P(Type II error)
117
- End Expander:
118
- Expander: Power
119
- Power is defined as 1 - Beta (β)
120
- Reminder: Beta is a False Negative (Type II error)
121
- so Beta is Failing to reject H₀ when it is actually false
122
-
123
- Mathematical Notation:
124
- Power = 1 – β
125
- Power = P(reject H₀ | Hₐ true)
126
- the conditional probability of rejecting the null hypothesis
127
- when the alternative hypothesis is true and the null is false
128
-
129
- R function:
130
- use power.t.test(), power.prop.test(), etc.
131
-
132
- *Example (power for one‐sample t):*
133
- *power.t.test(n = 20, delta = 1, sd = 2, sig.level = 0.05, type = "one.sample")*
134
- End Expander:
135
- Expander: One-Sample T-Test
136
- **Tests whether the mean of one group differs from a given value μ₀**
137
-
138
- Mathematical Notation:
139
- t = (x̄ – μ₀) / (s / √n), df = n – 1
140
-
141
- R function:
142
- t.test(x, mu, alternative, conf.level)
143
- *where:*
144
- – x: numeric vector
145
- – mu: hypothesized mean μ₀
146
- – alternative: "two.sided"/"greater"/"less"
147
- – conf.level: e.g. 0.95
148
-
149
- *Example:*
150
- *x = c(5.1, 4.9, 5.0, 5.2)*
151
- *t.test(x, mu = 5, alternative = "two.sided", conf.level = 0.95)*
152
- End Expander:
153
- Expander: Two-Sample T-Test
154
- **Tests whether two group means differ.**
155
-
156
- Mathematical Notation (unequal variances):
157
- t = (x̄₁ – x̄₂) / √(s₁²/n₁ + s₂²/n₂), df by Welch’s formula
158
-
159
- R function:
160
- t.test(x, y, var.equal = FALSE, alternative, conf.level)
161
- *where:*
162
- – x, y: numeric vectors for each group
163
- – var.equal: TRUE for pooled‐variance test, FALSE for Welch’s
164
-
165
- *Example:*
166
- *groupA = c(5.1,4.9,5.0,5.2)*
167
- *groupB = c(5.3,5.4,5.2,5.5)*
168
- *t.test(groupA, groupB, var.equal = FALSE)*
169
- End Expander:
170
- Expander: Z-test
171
- **Like a t-test but uses a known σ or large-n approximation**
172
-
173
- Mathematical Notation:
174
- z = (x̄ – μ₀) / (σ / √n), compare to N(0,1)
175
-
176
- R function:
177
- use BSDA::z.test() or do manually (below)
178
-
179
- *Example*
180
- *x = c(102, 98, 100, 101, 99)*
181
- *n = length(x)*
182
- *mu0 = 100*
183
- *sigma = 2*
184
- *z = (mean(x) - mu0) / (sigma / sqrt(n))*
185
- *p_value = 2 * pnorm(-abs(z)) # two‐sided*
186
- End Expander:
187
- Expander: Chi-Squared Test of Independence
188
- **Tests whether two Categorical variables are related**
189
-
190
- Mathematical Notation:
191
- χ² = Σ_{i,j} (O_{i,j} – E_{i,j})² / E_{i,j}, df = (rows–1)(cols–1)
192
-
193
- R function:
194
- chisq.test(x, correct = TRUE/FALSE)
195
- *where:*
196
- – x: contingency table (matrix or table)
197
- – correct: apply Yates’s continuity correction for 2×2 tables
198
-
199
- *Example:*
200
- *tbl = matrix(c(12, 5,7, 16), nrow = 2,*
201
- * dimnames = list(Gene = c("A","B"),*
202
- * Outcome = c("Yes","No")))*
203
- *chisq.test(tbl, correct = FALSE)*
204
- End Expander:
205
- Expander: Chi-Squared Goodness-of-Fit Test (Frequencies)
206
- **Tests if observed sample counts match expected proportions**
207
-
208
- Mathematical Notation:
209
- χ² = Σ (O_i – E_i)² / E_i, df = k – 1
210
-
211
- R function:
212
- chisq.test(x, p)
213
- *where:*
214
- – x: vector of observed counts
215
- – p: vector of hypothesized probabilities (sum to 1)
216
-
217
- *Example:*
218
- *observed = c(50, 30, 20)*
219
- *expected_probs = c(0.5, 0.3, 0.2)*
220
- *chisq.test(observed, p = expected_probs)*
221
- End Expander:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/assets/logo.jpg DELETED
Binary file (86.7 kB)
 
pages/assets/profile.txt DELETED
@@ -1,17 +0,0 @@
1
- # 🚀 Student Profile
2
-
3
- - **Student Name:** Charlie B
4
- - **Department:** BMO Wealth
5
- - **Expertise:** Intermediate
6
-
7
- ## 🎯 Interests:
8
- - Data science and analytics
9
- - Predictive models
10
- - Capital market applications
11
-
12
- ## 🎯 Goals for Next Review:
13
- - Complete topics in **Supervised Learning**.
14
- - Begin study on Advanced Optimization Methods.
15
- - Initiate **Computer Vision** topics.
16
-
17
- ** Keep up the excellent work **
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/assets/progress.txt DELETED
@@ -1,43 +0,0 @@
1
- # 🚀 Progress Report
2
-
3
- - **Student Name:** <Your Name>
4
- - **Enrollment Date:** Sept 15, 2025
5
- - **Report Date:** Nov 2, 2025
6
-
7
- ---
8
-
9
- # 📚 Progress Overview
10
- Completed topics are marked with a checkmark (✔️),
11
- while incomplete or pending topics remain unchecked.
12
-
13
- ## 📈 Overall Progress Summary
14
-
15
- | Curriculum Area | Completion (%) |
16
- |------------------------------|----------------|
17
- | Overview | 100% |
18
- | Inference Concepts | 100% |
19
- | One and Two-Tailed Tests | 100% |
20
- | Mathematical Concepts | 75% |
21
- | Normal Distribution | 75% |
22
- | T-tests | 70% |
23
- | Paired T-tests | 65% |
24
- | Chi-Squared Independence | 0% |
25
- | Chi-Squared Frequencies | 0% |
26
- | Summary | 0% |
27
-
28
- ---
29
-
30
- ## ✅ Statistics and Probability
31
- | Subtopic | Status |
32
- |----------------------------------------|---------|
33
- | Measures of Central Tendency | ✔️ |
34
- | Variance and Standard Deviation | ✔️ |
35
- | Probability Distributions | ✔️ |
36
- | Central Limit Theorem & Applications | ✔️ |
37
- | Hypothesis Testing | ✔️ |
38
- | Bayesian Statistics | |
39
-
40
- ---
41
-
42
- **Keep up the excellent work, you're well on your way**
43
- **to mastering this module! 🚀**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/load_pages.py DELETED
@@ -1,473 +0,0 @@
1
-
2
- # =========================================================================
3
- # Imports
4
- # =========================================================================
5
-
6
- import os, time, re, sys
7
- import numpy as np
8
- from openai import OpenAI
9
-
10
- import streamlit as st
11
- import streamlit.components.v1 as components
12
-
13
- import urllib.parse
14
-
15
- # =========================================================================
16
- # AI Response Dialog
17
- # =========================================================================
18
-
19
- @st.dialog("🤖 Response")
20
- def AI_gen_response(prompt):
21
-
22
- MIN_PROMPT_LENGTH = 6
23
-
24
- if len(prompt.strip()) < MIN_PROMPT_LENGTH:
25
- print("ERROR: AI prompt too short")
26
- st.markdown("*Your input is too short, please retype ...*") # clear output and print statement in italics
27
- return
28
-
29
- # AI API Call
30
-
31
- with st.spinner("Thinking ...", show_time=True):
32
-
33
- st.markdown("*Thinking about your response ...*") # clear output and print statement in italics
34
-
35
- full_text = []
36
- client = st.session_state["openai_client"]
37
-
38
- stream = client.chat.completions.create(
39
- model = st.session_state["openai_model"],
40
- messages = [{"role": "user", "content": prompt}], # {"role": "admin", "content": admin_prompt},
41
- stream = True,
42
- )
43
-
44
- for chunk in stream: # chunk is a ChatCompletionChunk
45
- delta = chunk.choices[0].delta # “what changed since the prev. chunk”
46
- if delta.content: # sometimes None (e.g. first chunk)
47
- print(delta.content, end="", flush=True) # live printing
48
- full_text.append(delta.content) # keep it if you need it
49
- response = "".join(full_text) # the entire response as one string
50
-
51
- format_text(response, input_directory="") # there is no input directory for the OpenAI API
52
-
53
- return response # return the response for more programming if needed
54
-
55
-
56
- # =========================================================================
57
- # Symbolic Lookup Table - Greek (lower and upper, math and equality signs)
58
- # =========================================================================
59
-
60
- SYMBOLS: dict[str, str] = {
61
- r"\alpha": "α", r"\beta": "β", r"\gamma": "γ", r"\delta": "δ",r"\epsilon": "ε",r"\zeta": "ζ", r"\eta": "η", r"\theta": "θ", r"\iota": "ι", r"\kappa": "κ", r"\lambda": "λ", r"\mu": "μ", r"\nu": "ν", r"\xi": "ξ", r"\omicron": "ο", r"\pi": "π", r"\rho": "ρ", r"\sigma": "σ", r"\tau": "τ", r"\upsilon": "υ", r"\phi": "φ", r"\chi": "χ", r"\psi": "ψ", r"\omega": "ω",
62
- r"\Alpha": "Α", r"\Beta": "Β", r"\Gamma": "Γ", r"\Delta": "Δ", r"\Epsilon": "Ε",r"\Zeta": "Ζ", r"\Eta": "Η", r"\Theta": "Θ", r"\Iota": "Ι", r"\Kappa": "Κ", r"\Lambda": "Λ", r"\Mu": "Μ", r"\Nu": "Ν", r"\Xi": "Ξ", r"\Omicron": "Ο", r"\Pi": "Π", r"\Rho": "Ρ", r"\Sigma": "Σ", r"\Tau": "Τ", r"\Upsilon": "Υ", r"\Phi": "Φ", r"\Chi": "Χ", r"\Psi": "Ψ", r"\Omega": "Ω",
63
- r"\pm": "±", r"\times": "×", r"\div": "÷", r"\cdot": "·", r"\sqrt": "√", r"\sum": "∑", r"\prod": "∏", r"\int": "∫", r"\infty": "∞", r"\partial": "∂", r"\nabla": "∇", r"\le": "≤", r"\ge": "≥", r"\neq": "≠", r"\approx": "≈",
64
- r"\and": "∧", r"\or": "∨", r"\neg": "¬", r"\in": "∈", r"\notin": "∉", r"\subset": "⊂", r"\subseteq": "⊆",r"\supset": "⊃", r"\supseteq": "⊇", r"\cup": "∪", r"\cap": "∩", r"\angle": "∠", r"\triangle": "△",
65
- r"\therefore": "∴", r"\because": "∵", r"\propto": "∝", r"\parallel": "∥",r"\perp": "⊥", r"\degree": "°", r"\bullet": "•", r"\rightarrow": "→", r"\leftarrow": "←", r"\uparrow": "↑",
66
- r"\downarrow": "↓", r"\leftrightarrow": "↔", r"\ell": "ℓ", r"\Re": "ℜ", r"\Im": "ℑ", r"\aleph": "ℵ", r"\wp": "℘"
67
- }
68
-
69
- # =====================================================
70
- # Functions - to convert symbol tags to symbols
71
- # =====================================================
72
-
73
- FORMULA_REGEX = re.compile(r'\\[A-Za-z]+')
74
- BOLD_TXT_REGEX = re.compile(r'\\[A-Za-z]+{([^{}]*)}')
75
-
76
- def test_load():
77
- # print("load_pages - testing external call") # DEBUG
78
- pass
79
-
80
- def latex_to_unicode(text: str, table: dict[str, str] = SYMBOLS) -> str:
81
- return FORMULA_REGEX.sub(lambda m: table.get(m.group(0), m.group(0)), text)
82
-
83
- def latex_bold_to_markdown(text: str) -> str:
84
- return BOLD_TXT_REGEX.sub(r'**\1**', text)
85
-
86
- # =====================================================================================
87
- # format_text - loads a text file, formats it and places streamlit components
88
- # based on instructions from the text file (lesson/learning module) file
89
- # =====================================================================================
90
-
91
- def format_text(input_text, input_directory=""):
92
-
93
- # --------------------------------------------------------------------------------
94
- # Uses text file as input - input_text
95
- # within the text are instructional tags used to build the content for the page
96
- # This code parses the text line-by-line to determine what to display for the page
97
- # --------------------------------------------------------------------------------
98
-
99
- # Parse the raw text for certain backslashes for mathematical formulae and
100
- # instruct the program to call the st.latex function to render
101
-
102
- input_text = input_text.replace("\\[\n",'st.latex("')
103
- input_text = input_text.replace("\\[",'st.latex("')
104
- input_text = input_text.replace("\n\\]\n",'")\n')
105
- input_text = input_text.replace("\\]\n",'")\n')
106
-
107
- # Split the text line by line to parse
108
-
109
- lines = input_text.split("\n")
110
- idx = 0
111
-
112
- # Scan each line
113
-
114
- while(idx<len(lines)):
115
-
116
- line = lines[idx].strip()
117
-
118
- # -------------------------------
119
- # Single-line interface tags
120
- # -------------------------------
121
-
122
- # Latex expression - render using st.latex()
123
-
124
- if line[:len("st.latex(")]=="st.latex(":
125
- if line[-2:]=='")':
126
- st.latex(line[len("st.latex(")+1:-2]) # closed expression
127
- else:
128
- st.latex(line[len("st.latex(")+1:]) # open expression
129
-
130
- elif line[:2]=='")': # closed expression notation - ignore
131
- pass
132
-
133
- # Question tag
134
-
135
- elif line[:len("Question: ")]=="Question: ":
136
- #st.text_area(label, value="", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility="visible")
137
- with st.expander(label = line[len("Question: [00_01_02]")+1:] + "...", expanded=False, icon=":material/live_help:"):
138
- question_key = line[11:19] # e.g. Question: [14_01_02]
139
- print(line, question_key)
140
- answer_text = st.text_area(label="Answer to Question", value="", height=200, key=question_key)
141
-
142
- # Hint tag
143
-
144
- elif line[:len("Hint: ")]=="Hint: ":
145
- Hint_text = line.split("...")
146
- with st.expander(label = Hint_text[0]+"...", expanded=False, icon=":material/voice_selection:"):
147
- st.markdown(Hint_text[1])
148
-
149
- # Load image tag - image is located in the module content folder and the tag has the file path
150
-
151
- elif line[:len("Image: ")]=="Image: ":
152
- file_str = line[len("Image: "):].strip()
153
- default_width = 700
154
- if file_str[-1]=="]": # a picture width (optional) is given
155
- default_width = int(file_str[file_str.find("[")+1:-1])
156
- file_str = file_str[:file_str.find("[")]
157
- st.image(file_str, width=default_width) # st.image(image, caption=None, width=None, use_column_width=None, clamp=False, channels="RGB", output_format="auto", *, use_container_width=False)
158
-
159
- # iFrame tag - render a web site in a container within a tab
160
-
161
- elif line[:len("iframe: ")]=="iframe: ":
162
- print("Running iframe")
163
- file_str = line[len("iframe: "):].strip() # Get web site
164
- file_str = file_str[1:-1] # Remove string delimiters
165
- print("Loading iframe:",file_str)
166
- components.iframe(file_str,500,500)
167
-
168
- # Link to sample code hosted externally e.g. Google Colab
169
-
170
- elif line[:len("Code: ")]=="Code: ":
171
- file_str = line[len("Code: "):].strip()
172
- with st.expander(label = "Code for this lesson ...", expanded=True, icon=":material/terminal:"):
173
- st.markdown(file_str)
174
-
175
- # HTML instructions rendered inside a frame e.g. an interactive javascript element
176
- # the HTML page is stored in the module content directory or is loaded from external source
177
-
178
- elif line[:len("HTML: ")]=="HTML: ": # An HTML page to load and display - eg Web Widget
179
-
180
- default_width = 700
181
- default_height = 700
182
-
183
- # print("HTML ",input_directory) # DEBUG
184
-
185
- file_str = line[len("HTML: "):].strip()
186
-
187
- if file_str[-1]=="]": # an optional video width is given
188
- default_width = int(file_str[file_str.find("[")+1:-1])
189
- default_height = default_width # square by default
190
- file_str = file_str[:file_str.find("[")]
191
-
192
- if file_str[:4] != "http":
193
- file_str = os.path.join(input_directory,file_str)
194
-
195
- # print(file_str) # DEBUG
196
-
197
- try:
198
- html_str = open(file_str, "r", encoding="UTF-8").read()
199
- except Exception as err:
200
- print(f"Unexpected {err=}, {type(err)=}",file_str)
201
- else:
202
- components.html(html_str, height=default_height, width=default_width, scrolling=True)
203
-
204
- # External Web Link
205
-
206
- elif line[:len("Link: ")]=="Link: ":
207
- file_str = line[len("Link: "):].strip()
208
- st.markdown(file_str)
209
-
210
- # Text that can be copied
211
-
212
- elif line[:len("Copy: ")]=="Copy: ":
213
- file_str = line[len("Copy: "):].strip()
214
- st.code(file_str,language="")
215
-
216
- # Video
217
-
218
- elif line[:len("Video: ")]=="Video: ":
219
-
220
- default_width = 700
221
-
222
- file_str = line[len("Video: "):].strip()
223
-
224
- if file_str[-1]=="]": # an optional video width is given
225
- default_width = int(file_str[file_str.find("[")+1:-1])
226
- file_str = file_str[:file_str.find("[")]
227
-
228
- video_filepath = os.path.join(st.session_state["start_dir"],"pages",input_directory,file_str)
229
- video_file = open(video_filepath,"rb")
230
-
231
- if video_file is None:
232
- print("ERROR: Video did not load: ",video_filepath)
233
- else:
234
- intro_video = video_file.read()
235
- st.video(intro_video, loop=True, autoplay=True, muted=False) # width=default_width) in doc v1.4.6 (reload ??)
236
-
237
-
238
- # ---------------------------------------------------------------------
239
- # Multi-line interface tags
240
- # These tags tell the program to scan ahead and read lines until a
241
- # closure tag is found. The line pointer is advanced accordingly
242
- # ---------------------------------------------------------------------
243
-
244
- # R Code is run in an embedded widget. This will prepopluate the widget with the example code
245
-
246
- elif line[:len("Expander:")]=="Expander:":
247
-
248
- default_width = 800
249
-
250
- expander_headline = line[len("Expander:"):].strip()
251
- expander_string = ""
252
-
253
- for c, expander_line in enumerate(lines[idx+1:]):
254
- if expander_line[:len("End Expander:")]=="End Expander:":
255
- idx+=1 # skip this line
256
- break
257
- else:
258
- expander_string += expander_line + "\n"
259
-
260
- idx+=c # Set global counter to skip past the lines already read in lookahead mode
261
-
262
- with st.expander(label = expander_headline+"...", expanded=False, icon=":material/stars_2:"): # ,width=default_width):
263
- for expander_line in expander_string.split("\n"):
264
- #st.write(expander_line)
265
- st.markdown(expander_line)
266
-
267
- # R Code is run in an embedded widget. This will prepopluate the widget with the example code
268
-
269
- elif line[:len("R Code:")]=="R Code:":
270
-
271
- r_code_string = ""
272
-
273
- for c, r_code_line in enumerate(lines[idx+1:]):
274
- if r_code_line[:len("End R Code:")]=="End R Code:":
275
- idx+=1 # skip this line
276
- break
277
- else:
278
- r_code_string += r_code_line + "\n"
279
-
280
- idx+=c # Set global counter to skip past the lines already read in lookahead mode
281
-
282
- URI_code = urllib.parse.quote(r_code_string)
283
- components.html("<iframe width='675' height='575' src='https://rdrr.io/snippets/embed/?code=" + URI_code + "' frameborder='0'></iframe>", height=600, width = 700, scrolling=True)
284
-
285
- # ---------------------------------------------------------------------
286
- # A Cognitive Checkpoint is a point in the module where the student is asked to
287
- # write a briefing that demonstrates whether they understand a concept
288
- # The briefing is sent to the AI for evaluation
289
- # Constructing this as a multi-line input gives the ability to enhance the admin prompt
290
- # which will need custom instructions based on the checkpoint
291
- # ---------------------------------------------------------------------
292
-
293
- elif line[:len("Cognitive Checkpoint:")]=="Cognitive Checkpoint:":
294
-
295
- question_key = line[23:31] # Unique key for response
296
- question = "" # Multi-line question for cognitive response
297
-
298
- for c, question_line in enumerate(lines[idx+1:]):
299
- if question_line[:len("End Cognitive Checkpoint:")]=="End Cognitive Checkpoint:":
300
- idx+=1 # skip this line
301
- break
302
- else:
303
- question += question_line + "\n"
304
-
305
- idx+=c # Set global counter to skip past the lines already read in lookahead mode
306
-
307
- st.write(question) # Write question
308
-
309
- # Provide area to write response
310
-
311
- with st.expander(label = "Cognitive Checkpoint:", expanded=True, icon=":material/live_help:"):
312
-
313
- if answer_text := st.text_area(label="Answer to Question", value="", height=150, key=question_key): # := is the "Walrus Operator - assigns, checks and runs function"
314
-
315
- admin_prompt = '''
316
- You are a teacher.
317
- Evaluate the following statement delimited in square brackets for accuracy from your student.
318
- For each logical statement, grade it as one of three options: correct, misunderstanding, incorrect.
319
- For each statement cite the grade, student comment, your response, corrected response if required.
320
- Provide a summary at the end, not in table form, with the grade and a summary of the student comment
321
- '''
322
-
323
- # Return your assessment in JSON format # Optional - for eval purposes
324
-
325
- AI_question = admin_prompt + "[" + answer_text + "]"
326
-
327
- try:
328
- AI_gen_response(prompt=AI_question)
329
- except Exception as e:
330
- print("ERROR: Dialog box open. Message suppressed\n",str(e))
331
-
332
-
333
- # ------------------------------------------
334
- # DEFAULT Instructions if no tag is provided
335
- # ------------------------------------------
336
-
337
- else:
338
- line_unicode = latex_to_unicode(line) # convert text to unicode symbols if needed
339
- line_bold = latex_bold_to_markdown(line_unicode) # bold text
340
- # print(line_bold)
341
- st.markdown(line_bold) # markdown that line
342
-
343
- # ------------------------------------------
344
- # Increment line counter / go to next line
345
- # ------------------------------------------
346
-
347
- idx+=1
348
-
349
-
350
- # END Parse text
351
-
352
- return
353
-
354
-
355
- # =====================================================
356
- # Load Content
357
- # =====================================================
358
-
359
- def load_content(module):
360
-
361
- input_directory = os.path.join(st.session_state["start_dir"],"pages","modules",module)
362
-
363
- # if file exists - otherwise do nothing
364
- content_str = open(os.path.join(input_directory,"Overview.txt"), "r", encoding="UTF-8").read()
365
- tab_content = content_str.split("---\n")
366
-
367
- # Display Module title if one is given, otherwise blank
368
-
369
- title = tab_content[0].strip()
370
- if len(title)>0:
371
- st.subheader(title)
372
-
373
- # Draw tabs according to page count
374
-
375
- tab_list = ["🚀"+str(idx+1) for idx,x in enumerate(tab_content[1:])]
376
- tabs = st.tabs(tab_list)
377
-
378
- # For each tab, render the appropriate content
379
-
380
- for idx,tab in enumerate(tabs):
381
- with tab:
382
- format_text(tab_content[idx+1], input_directory)
383
-
384
- # Add AI Bot Interface to bottom of page
385
-
386
- ## if prompt := st.chat_input("I would like to learn about ..."):
387
- ## AI_gen_response(prompt=prompt)
388
-
389
- return
390
-
391
- # =====================================================
392
- # Load Page
393
- # =====================================================
394
-
395
- def load_page(module):
396
-
397
- if "logged_in" not in st.session_state: # User is not logged in - don't load content
398
- return
399
-
400
- # --------------------------------------------------
401
- # Sidebar
402
- # --------------------------------------------------
403
-
404
- asset_dir = os.path.join(st.session_state["start_dir"],"pages","assets")
405
-
406
- with st.sidebar:
407
-
408
- with st.expander("Lessons", expanded=True, icon=":material/library_books:"):
409
-
410
- st.page_link("pages/Overview.py", label="The ASCEND User Interface", icon=":material/rocket_launch:")
411
- st.page_link("pages/Module_01.py", label="Basic Training", icon=":material/school:")
412
- st.page_link("pages/Module_02.py", label="Mathematical Foundations", icon=":material/difference:")
413
- st.page_link("pages/Module_03.py", label="The Normal Distribution", icon=":material/cadence:")
414
- st.page_link("pages/Module_04.py", label="One Sided Tests", icon=":material/compare:")
415
- st.page_link("pages/Module_05.py", label="Tests for Two Samples", icon=":material/speed_2x:")
416
- st.page_link("pages/Module_06.py", label="Paired Tests", icon=":material/speed_2x:")
417
- st.page_link("pages/Module_07.py", label="Testing Independence", icon=":material/superscript:")
418
- st.page_link("pages/Module_08.py", label="Testing Frequencies", icon=":material/superscript:")
419
- st.page_link("pages/Module_09.py", label="Summary", icon=":material/format_list_numbered:")
420
- st.page_link("pages/Bonus.py", label="Bonus Content", icon="🎁")
421
-
422
- with st.expander("Ask the AI", expanded=False, icon=":material/smart_toy:"):
423
-
424
- if AI_question := st.text_input(label="Ask the AI", value="", key="AI_Question"):
425
- try:
426
- AI_gen_response(prompt=AI_question)
427
- except Exception as e:
428
- print("ERROR: Dialog box open. Message suppressed\n",str(e))
429
-
430
- # Callback function to clear text from previous AI question inputs
431
-
432
- def set_name(new_text):
433
- st.session_state.AI_Question = new_text
434
-
435
- st.button('Clear',on_click=set_name, args=[''])
436
-
437
- with st.expander("R Calculator", expanded=False, icon=":material/calculate:"):
438
- components.html("<iframe width='500' height='500' src='https://rdrr.io/snippets/embed/?code=""' frameborder='0'></iframe>", height=550, width = 550, scrolling=True)
439
-
440
- # Streamlit 1.47 is required to run expanders within expanders
441
- #with st.expander("Statistical Tests", expanded=False, icon=":material/functions:"):
442
- # overview_dir = os.path.join(st.session_state["start_dir"],"pages","assets")
443
- # overview_str = open(os.path.join(overview_dir,"formulas.txt"), "r", encoding="UTF-8").read()
444
- # format_text(overview_str, overview_dir)
445
-
446
- with st.expander("Your Progress",expanded=False, icon=":material/preliminary:"):
447
- progress_str = open(os.path.join(st.session_state["start_dir"],"pages","assets","progress.txt"), "r", encoding="UTF-8").read()
448
- st.markdown(progress_str)
449
-
450
- with st.expander("Logout", expanded=False, icon=":material/logout:"): #
451
- if st.button("Logout"):
452
- del st.session_state["logged_in"]
453
- st.switch_page("app.py") # switch to main page
454
- st.rerun() # should invoke login dialog
455
-
456
- # END Sidebar
457
-
458
- # --------------------------------------------------
459
- # Main Screen Content - e.g. Pages with Tabs
460
- # --------------------------------------------------
461
-
462
- if "logged_in" not in st.session_state: # check if user has logged out with sidebar
463
- pass
464
- else:
465
- load_content(module) # otherwise load and provide access to the content
466
-
467
- # =================================================
468
- # Standalone Code if Program is Run as Main
469
- # =================================================
470
-
471
- if __name__ == "__main__":
472
- pass
473
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/modules/Bonus/Overview - Backup.txt DELETED
@@ -1,43 +0,0 @@
1
-
2
- ---
3
-
4
- R Code:
5
-
6
- set.seed(42)
7
-
8
- # 1. Simulate rolls for Set A (fair dice) and Set B (slightly high-biased dice)
9
- N <- 1000
10
- # Fair dice: equal probs 1–6
11
- rolls_A <- replicate(N, sum(sample(1:6, 2, replace=TRUE)))
12
- # Biased dice: face “6” is more likely
13
- p_biased <- c(1,1,1,1,1,5)/10
14
- rolls_B <- replicate(N, sum(sample(1:6, 2, replace=TRUE, prob=p_biased)))
15
-
16
- # 2. Summarize
17
- mean_A <- mean(rolls_A); sd_A <- sd(rolls_A)
18
- mean_B <- mean(rolls_B); sd_B <- sd(rolls_B)
19
- cat("Set A: mean =", round(mean_A,3), " sd =", round(sd_A,3), "\n",
20
- "Set B: mean =", round(mean_B,3), " sd =", round(sd_B,3), "\n\n")
21
-
22
- # 3. Two-sample Welch t-test
23
- test_two_sample <- t.test(rolls_A, rolls_B)
24
- print(test_two_sample)
25
-
26
- # 4. Visualize: overlaid histograms
27
- hist(rolls_A, freq=FALSE, col=rgb(0,0,1,0.4),
28
- xlim=c(2,12), ylim=c(0,0.35),
29
- main="Fair (blue) vs Biased (red) Dice Sums",
30
- xlab="Sum of Two Dice", ylab="Density")
31
- hist(rolls_B, freq=FALSE, col=rgb(1,0,0,0.4), add=TRUE)
32
- legend("topright",
33
- legend=c("Set A (fair)", "Set B (biased)"),
34
- fill=c(rgb(0,0,1,0.4), rgb(1,0,0,0.4)))
35
-
36
- End R Code:
37
-
38
- ---
39
- iframe: "https://theplayroom.babylonjs.com/"
40
- ---
41
- iframe: "https://time-loop.fr/Arques/EXPERIENCES/3DSCAN/#!/"
42
- ---
43
- iframe: "https://www.babylonjs.com/viewer.html?url=https://babylonjsassetslib.z01.azurefd.net/DEMOS/demos/monstera_deliciosa_potted_mid-century_plant.glb"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/modules/Bonus/Overview.txt DELETED
@@ -1,108 +0,0 @@
1
-
2
- ---
3
- ## Navigational Map
4
- #### Click Start> below to navigate Statistical Inference tests and when to use them
5
- HTML: navigational_map.html[1100]
6
- ---
7
- Image: pages/modules/Bonus/checkpoint_banner.jpg
8
-
9
- Cognitive Checkpoint: [00-00-00]
10
- - Describe what statistical inference is and how it is applied
11
- - Using the example of "Do unicorns exist", walkthrough the steps for a statistical inference test
12
- - When would my test be statistically significant ?
13
- - If statistically significant, would this prove unicorns exist and why?
14
- End Cognitive Checkpoint:
15
- ---
16
- R Code:
17
-
18
- trial_sizes <- c(10, 100, 1000, 10000)
19
-
20
- # Prepare 2×2 plotting area
21
- par(mfrow = c(2, 2),
22
- mar = c(4, 4, 2, 1) + 0.1) # adjust margins: bottom, left, top, right
23
-
24
- # Loop over each sample size
25
- for (n_trials in trial_sizes) {
26
-
27
- # Simulate sums of two fair dice
28
- roll_sums <- replicate(n_trials,
29
- sum(sample(1:6, size = 2, replace = TRUE)))
30
-
31
- # Estimate mean and sd
32
- mu_hat <- mean(roll_sums)
33
- sigma_hat <- sd(roll_sums)
34
-
35
- # Plot histogram scaled to density
36
- hist(roll_sums,
37
- breaks = seq(1.5, 12.5, by = 1),
38
- probability = TRUE,
39
- col = "lightblue",
40
- border = "white",
41
- xlim = c(2, 12),
42
- ylim = c(0, 0.30),
43
- xlab = "Sum of Two Dice",
44
- main = paste("n =", n_trials))
45
-
46
- # Overlay Normal curve with estimated parameters
47
- x_vals <- seq(2, 12, length.out = 200)
48
- y_vals <- dnorm(x_vals, mean = mu_hat, sd = sigma_hat)
49
- lines(x_vals, y_vals, col = "red", lwd = 2)
50
-
51
- # Add legend
52
- legend("topright",
53
- legend = sprintf("N(%.2f, %.2f²)", mu_hat, sigma_hat),
54
- lty = 1,
55
- col = "red",
56
- bty = "n")
57
- }
58
-
59
- # Reset plotting parameters if needed
60
- par(mfrow = c(1,1))
61
-
62
- End R Code:
63
-
64
- ---
65
- #### Test yourself using the flashcards
66
- HTML: flashcards.html
67
-
68
- ---
69
- #### Statistical Inference Walkthrough
70
-
71
- Expander: Frame Your Question as Two Competing Stories
72
- • Base story (“null hypothesis”): The dice are fair
73
- • Alternative story: The dice are biased so low or high sums occur more often than with fair dice
74
- End Expander:
75
- Expander: Gather Your Evidence
76
- • Decide how many times you will roll the dice.
77
- • Keep track of the outcome (the sum) for each roll.
78
- End Expander:
79
- Expander: Summarize What You See
80
- • Organize your recorded sums in a simple way (e.g count how often each sum appears)
81
- • Look for patterns — do certain sums show up more or less often?
82
- End Expander:
83
- Expander: Compare to What You’d Expect If the Dice Were Fair
84
- • Ask yourself: “Do the patterns I see match what typically happens with fair dice?”
85
- • Remember even fair dice will show high or low counts in a limited set of rolls
86
- End Expander:
87
- Expander: Judge whether the Differences Are Random or Suggest Bias
88
- • Small fluctuations are normal when you roll only a few times
89
- • Very large or consistent departures from the fair-dice pattern might indicate bias
90
- End Expander:
91
- Expander: Reach a Conclusion
92
- • If your observed pattern looks fair dice allowing for normal ups and downs, you observe the dice are fair
93
- • If the pattern is so skewed it seems unlikely, you go with the belief the dice are biased
94
- End Expander:
95
- Expander: Summary of statistical inference
96
- • Starting with a clear question (fair vs. biased dice).
97
- • Collecting and summarizing real-world data (rolls and sums).
98
- • Judging how well that data lines up with the “fair dice” story.
99
- • Making a reasoned decision whether the dice are fair or likely biased
100
- End Expander:
101
- ---
102
- Image: pages/modules/Bonus/astro_thumbsup.jpg[1024]
103
-
104
-
105
-
106
-
107
-
108
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/modules/Bonus/astro_checkpoint.jpg DELETED
Binary file (97 kB)
 
pages/modules/Bonus/astro_thumbsup.jpg DELETED
Binary file (83.4 kB)
 
pages/modules/Bonus/checkpoint_banner - backup.jpg DELETED

Git LFS Details

  • SHA256: b12d9e6e0da7ec34fbcb53d14e6b71adfd55121f00cda12aae29fa74025d2f07
  • Pointer size: 131 Bytes
  • Size of remote file: 371 kB
pages/modules/Bonus/checkpoint_banner.jpg DELETED
Binary file (29.4 kB)
 
pages/modules/Bonus/flashcards - Copy.html DELETED
@@ -1,182 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Statistical Inference Flashcards</title>
6
- <style>
7
- body {
8
- font-family: Arial, sans-serif;
9
- background: #f0f0f0;
10
- margin: 0;
11
- padding: 20px;
12
- }
13
- h1 {
14
- text-align: center;
15
- }
16
- .flashcard {
17
- position: relative;
18
- width: 300px;
19
- height: 200px;
20
- margin: 40px auto;
21
- padding: 20px;
22
- background: #fff;
23
- border-radius: 8px;
24
- box-shadow: 0 4px 8px rgba(0,0,0,0.2);
25
- display: flex;
26
- align-items: center;
27
- justify-content: center;
28
- text-align: center;
29
- font-size: 18px;
30
- cursor: pointer;
31
- user-select: none;
32
- }
33
- .checkmark {
34
- position: absolute;
35
- top: 10px;
36
- right: 10px;
37
- font-size: 24px;
38
- color: gray;
39
- cursor: pointer;
40
- }
41
- #controls {
42
- text-align: center;
43
- margin-top: 20px;
44
- }
45
- #controls button {
46
- padding: 8px 16px;
47
- margin: 0 10px;
48
- font-size: 16px;
49
- }
50
- #controls button:disabled {
51
- opacity: 0.5;
52
- cursor: not-allowed;
53
- }
54
- </style>
55
- </head>
56
- <body>
57
- <h1>Statistical Inference Flashcards</h1>
58
-
59
- <div id="flashcard" class="flashcard">
60
- <div id="checkmark" class="checkmark">✔</div>
61
- <div id="content"></div>
62
- </div>
63
-
64
- <div id="controls">
65
- <button id="prev">Previous</button>
66
- <button id="next">Next</button>
67
- </div>
68
-
69
- <script>
70
- // 10 sample flashcards
71
- const flashcards = [
72
- {
73
- question: "What is a null hypothesis?",
74
- answer: "A statement that there is no effect or difference, which we test against alternative evidence.",
75
- correct: false
76
- },
77
- {
78
- question: "What is a p-value?",
79
- answer: "The probability of observing data at least as extreme as yours if the null hypothesis is true.",
80
- correct: false
81
- },
82
- {
83
- question: "What does a confidence interval tell you?",
84
- answer: "A range of values where we believe the true parameter lies, with a certain level of confidence (e.g., 95%).",
85
- correct: false
86
- },
87
- {
88
- question: "What is a Type I error?",
89
- answer: "Incorrectly rejecting the null hypothesis when it is actually true (a false positive).",
90
- correct: false
91
- },
92
- {
93
- question: "What is a Type II error?",
94
- answer: "Failing to reject the null hypothesis when it is actually false (a false negative).",
95
- correct: false
96
- },
97
- {
98
- question: "What is statistical power?",
99
- answer: "The probability of correctly rejecting a false null hypothesis (1 minus the Type II error rate).",
100
- correct: false
101
- },
102
- {
103
- question: "What is the difference between one-tailed and two-tailed tests?",
104
- answer: "One-tailed tests check for an effect in a specific direction; two-tailed tests check for any effect in either direction.",
105
- correct: false
106
- },
107
- {
108
- question: "What is a t-test used for?",
109
- answer: "Comparing the means of two groups to see if they are statistically different from each other.",
110
- correct: false
111
- },
112
- {
113
- question: "What is the bootstrap method?",
114
- answer: "A technique that estimates the sampling distribution by repeatedly resampling the data with replacement.",
115
- correct: false
116
- },
117
- {
118
- question: "What is Bayesian inference?",
119
- answer: "An approach that updates the probability of a hypothesis based on prior beliefs and new evidence.",
120
- correct: false
121
- }
122
- ];
123
-
124
- let currentIndex = 0;
125
- let showAnswer = false;
126
-
127
- const cardEl = document.getElementById('flashcard');
128
- const contentEl = document.getElementById('content');
129
- const checkEl = document.getElementById('checkmark');
130
- const prevBtn = document.getElementById('prev');
131
- const nextBtn = document.getElementById('next');
132
-
133
- function renderCard() {
134
- const card = flashcards[currentIndex];
135
-
136
- if (showAnswer) {
137
- contentEl.textContent = card.answer;
138
- checkEl.style.display = 'none';
139
- } else {
140
- contentEl.textContent = card.question;
141
- checkEl.style.display = 'block';
142
- checkEl.style.color = card.correct ? 'green' : 'gray';
143
- }
144
-
145
- prevBtn.disabled = currentIndex === 0;
146
- nextBtn.disabled = currentIndex === flashcards.length - 1;
147
- }
148
-
149
- // Flip card on click (except when clicking the checkmark)
150
- cardEl.addEventListener('click', () => {
151
- showAnswer = !showAnswer;
152
- renderCard();
153
- });
154
-
155
- // Toggle correct mark
156
- checkEl.addEventListener('click', e => {
157
- e.stopPropagation(); // don't also flip the card
158
- flashcards[currentIndex].correct = !flashcards[currentIndex].correct;
159
- renderCard();
160
- });
161
-
162
- prevBtn.addEventListener('click', () => {
163
- if (currentIndex > 0) {
164
- currentIndex--;
165
- showAnswer = false;
166
- renderCard();
167
- }
168
- });
169
-
170
- nextBtn.addEventListener('click', () => {
171
- if (currentIndex < flashcards.length - 1) {
172
- currentIndex++;
173
- showAnswer = false;
174
- renderCard();
175
- }
176
- });
177
-
178
- // Initial display
179
- renderCard();
180
- </script>
181
- </body>
182
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/modules/Bonus/flashcards.html DELETED
@@ -1,180 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Statistical Inference Flashcards</title>
6
- <style>
7
- body {
8
- font-family: Arial, sans-serif;
9
- background: #f0f0f0;
10
- margin: 0;
11
- padding: 20px;
12
- }
13
- h1 {
14
- text-align: center;
15
- }
16
- .flashcard {
17
- position: relative;
18
- width: 400px;
19
- height: 400px;
20
- margin: 40px auto;
21
- padding: 20px;
22
- background: #fff;
23
- border-radius: 8px;
24
- box-shadow: 0 4px 8px rgba(0,0,0,0.2);
25
- display: flex;
26
- align-items: center;
27
- justify-content: center;
28
- text-align: center;
29
- font-size: 18px;
30
- cursor: pointer;
31
- user-select: none;
32
- }
33
- .checkmark {
34
- position: absolute;
35
- top: 10px;
36
- right: 10px;
37
- font-size: 24px;
38
- color: gray;
39
- cursor: pointer;
40
- }
41
- #controls {
42
- text-align: center;
43
- margin-top: 20px;
44
- }
45
- #controls button {
46
- padding: 8px 16px;
47
- margin: 0 10px;
48
- font-size: 16px;
49
- }
50
- #controls button:disabled {
51
- opacity: 0.5;
52
- cursor: not-allowed;
53
- }
54
- </style>
55
- </head>
56
- <body>
57
- <div id="flashcard" class="flashcard">
58
- <div id="checkmark" class="checkmark">✔</div>
59
- <div id="content"></div>
60
- </div>
61
-
62
- <div id="controls">
63
- <button id="prev">Previous</button>
64
- <button id="next">Next</button>
65
- </div>
66
-
67
- <script>
68
- // 10 sample flashcards
69
- const flashcards = [
70
- {
71
- question: "What is a null hypothesis?",
72
- answer: "A statement that there is no effect or difference, which we test against alternative evidence.",
73
- correct: false
74
- },
75
- {
76
- question: "What is a p-value?",
77
- answer: "The probability of observing data at least as extreme as yours if the null hypothesis is true.",
78
- correct: false
79
- },
80
- {
81
- question: "What does a confidence interval tell you?",
82
- answer: "A range of values where we believe the true parameter lies, with a certain level of confidence (e.g., 95%).",
83
- correct: false
84
- },
85
- {
86
- question: "What is a Type I error?",
87
- answer: "Incorrectly rejecting the null hypothesis when it is actually true (a false positive).",
88
- correct: false
89
- },
90
- {
91
- question: "What is a Type II error?",
92
- answer: "Failing to reject the null hypothesis when it is actually false (a false negative).",
93
- correct: false
94
- },
95
- {
96
- question: "What is statistical power?",
97
- answer: "The probability of correctly rejecting a false null hypothesis (1 minus the Type II error rate).",
98
- correct: false
99
- },
100
- {
101
- question: "What is the difference between one-tailed and two-tailed tests?",
102
- answer: "One-tailed tests check for an effect in a specific direction; two-tailed tests check for any effect in either direction.",
103
- correct: false
104
- },
105
- {
106
- question: "What is a t-test used for?",
107
- answer: "Comparing the means of two groups to see if they are statistically different from each other.",
108
- correct: false
109
- },
110
- {
111
- question: "What is the bootstrap method?",
112
- answer: "A technique that estimates the sampling distribution by repeatedly resampling the data with replacement.",
113
- correct: false
114
- },
115
- {
116
- question: "What is Bayesian inference?",
117
- answer: "An approach that updates the probability of a hypothesis based on prior beliefs and new evidence.",
118
- correct: false
119
- }
120
- ];
121
-
122
- let currentIndex = 0;
123
- let showAnswer = false;
124
-
125
- const cardEl = document.getElementById('flashcard');
126
- const contentEl = document.getElementById('content');
127
- const checkEl = document.getElementById('checkmark');
128
- const prevBtn = document.getElementById('prev');
129
- const nextBtn = document.getElementById('next');
130
-
131
- function renderCard() {
132
- const card = flashcards[currentIndex];
133
-
134
- if (showAnswer) {
135
- contentEl.textContent = card.answer;
136
- checkEl.style.display = 'none';
137
- } else {
138
- contentEl.textContent = card.question;
139
- checkEl.style.display = 'block';
140
- checkEl.style.color = card.correct ? 'green' : 'gray';
141
- }
142
-
143
- prevBtn.disabled = currentIndex === 0;
144
- nextBtn.disabled = currentIndex === flashcards.length - 1;
145
- }
146
-
147
- // Flip card on click (except when clicking the checkmark)
148
- cardEl.addEventListener('click', () => {
149
- showAnswer = !showAnswer;
150
- renderCard();
151
- });
152
-
153
- // Toggle correct mark
154
- checkEl.addEventListener('click', e => {
155
- e.stopPropagation(); // don't also flip the card
156
- flashcards[currentIndex].correct = !flashcards[currentIndex].correct;
157
- renderCard();
158
- });
159
-
160
- prevBtn.addEventListener('click', () => {
161
- if (currentIndex > 0) {
162
- currentIndex--;
163
- showAnswer = false;
164
- renderCard();
165
- }
166
- });
167
-
168
- nextBtn.addEventListener('click', () => {
169
- if (currentIndex < flashcards.length - 1) {
170
- currentIndex++;
171
- showAnswer = false;
172
- renderCard();
173
- }
174
- });
175
-
176
- // Initial display
177
- renderCard();
178
- </script>
179
- </body>
180
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/modules/Bonus/navigational_map.html DELETED
@@ -1,176 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Navigational Map</title>
6
- <style>
7
- body { font-family: sans-serif; }
8
- svg { border: 1px solid #ccc; }
9
- rect { cursor: pointer; }
10
- </style>
11
- </head>
12
- <body>
13
- <svg id="tree" width="1000" height="600">
14
- <defs>
15
- <marker id="arrow"
16
- markerWidth="10" markerHeight="10"
17
- refX="0" refY="3"
18
- orient="auto">
19
- <path d="M0,0 L0,6 L9,3 z" fill="#000"/>
20
- </marker>
21
- </defs>
22
- <g id="lines"></g>
23
- <g id="nodes"></g>
24
- </svg>
25
-
26
- <!-- Script is placed *after* the SVG so we can initialize immediately -->
27
- <script>
28
- (function(){
29
- var svg = document.getElementById('tree'),
30
- linesG = document.getElementById('lines'),
31
- nodesG = document.getElementById('nodes'),
32
- totalLvls = 5,
33
- maxNodes = Math.pow(2, totalLvls) - 1, // 31
34
- rectSize = 35,
35
- marginX = 50,
36
- hSpacing = 150,
37
- // parseFloat in case someone ever writes "600px"
38
- W = parseFloat(svg.getAttribute('width')),
39
- H = parseFloat(svg.getAttribute('height')),
40
- shown = {}; // tracks which indices are already drawn
41
-
42
- // 1) generate labels A..Z, then 1..5
43
-
44
- var labels = [];
45
-
46
- // Add Labels (= MaxNodes = for 5 levels = 2^5-1 = 32-1 = 31)
47
-
48
- labels[ 1] = "Start ➤"
49
- labels[ 2] = "Mean"
50
- labels[ 3] = "Frequency"
51
- labels[ 4] = "1 Mean"
52
- labels[ 5] = "2 Means"
53
- labels[ 6] = "1 Variable"
54
- labels[ 7] = "2 Variables"
55
- labels[ 8] = "Population"
56
- labels[ 9] = "Sample"
57
-
58
- labels[10] = "Dependent"
59
- labels[11] = "Independent"
60
- labels[12] = ""
61
- labels[13] = "Chi Frequency 🚀"
62
- labels[14] = "Chi Independence🚀"
63
- labels[15] = ""
64
- labels[16] = ""
65
- labels[17] = "Z Score 🚀"
66
- labels[18] = ""
67
- labels[19] = "T Score 🚀"
68
-
69
- labels[20] = ""
70
- labels[21] = "Dependent T 🚀"
71
- labels[22] = ""
72
- labels[23] = "Independent T 🚀"
73
- labels[24] = ""
74
- labels[25] = ""
75
- labels[26] = ""
76
- labels[27] = ""
77
- labels[28] = ""
78
- labels[29] = ""
79
-
80
- labels[30] = ""
81
- labels[31] = ""
82
-
83
- var hide = [];
84
-
85
- for (i = 1; i <= maxNodes; i++) {
86
- if (labels[i]=="") {
87
- hide[i]=true;
88
- }
89
- }
90
-
91
- // 2) precompute (x,y) for each node
92
-
93
- var pos = [];
94
-
95
- for (i = 1; i <= maxNodes; i++) {
96
- var lvl = Math.floor(Math.log2(i)),
97
- lvlStart = Math.pow(2, lvl),
98
- idxInLvl = i - lvlStart,
99
- nodesInLvl= lvlStart,
100
- vSpacing = H / (nodesInLvl + 1),
101
- x = marginX + lvl * hSpacing,
102
- y = vSpacing * (idxInLvl + 1);
103
- pos[i] = { x: x, y: y };
104
- }
105
-
106
- // 3) draw one node (square + text) and hook up its click
107
-
108
- function drawNode(i) {
109
-
110
- if (i < 1 || i > maxNodes || shown[i]) return;
111
- shown[i] = true;
112
- var p = pos[i];
113
-
114
- var g = document.createElementNS('http://www.w3.org/2000/svg','g');
115
- var r = document.createElementNS('http://www.w3.org/2000/svg','rect');
116
- r.setAttribute('x', p.x - rectSize/2);
117
- r.setAttribute('y', p.y - rectSize/2);
118
- r.setAttribute('width', rectSize*6);
119
- r.setAttribute('height', rectSize);
120
- r.setAttribute('fill', '#b3d9ff');
121
- r.setAttribute('stroke', '#000');
122
- r.setAttribute('cursor', 'pointer');
123
-
124
- g.appendChild(r);
125
-
126
- var t = document.createElementNS('http://www.w3.org/2000/svg','text');
127
- t.setAttribute('x', p.x - 10);
128
- t.setAttribute('y', p.y + 2);
129
- t.setAttribute('text-anchor', 'left');
130
- t.setAttribute('alignment-baseline','middle');
131
- t.textContent = labels[i];
132
- g.appendChild(t);
133
-
134
- g.addEventListener('click', function(evt){
135
- evt.stopPropagation();
136
- expand(i);
137
- });
138
-
139
- nodesG.appendChild(g);
140
- }
141
-
142
- // 4) when you click a node, draw lines & show its two children
143
-
144
- function expand(i) {
145
-
146
- var p = pos[i];
147
-
148
- [2*i, 2*i + 1].forEach(function(c){
149
-
150
- if (c <= maxNodes && !shown[c] && !hide[c] ) {
151
-
152
- var cp = pos[c],
153
- l = document.createElementNS('http://www.w3.org/2000/svg','line');
154
-
155
- l.setAttribute('x1', p.x);
156
- l.setAttribute('y1', p.y);
157
- l.setAttribute('x2', cp.x);
158
- l.setAttribute('y2', cp.y);
159
- l.setAttribute('stroke', '#000');
160
- l.setAttribute('marker-end', 'url(#arrow)');
161
-
162
- linesG.appendChild(l);
163
- drawNode(c);
164
-
165
- }
166
- });
167
- }
168
-
169
- // 5) very first call draws the root (node #1)
170
-
171
- drawNode(1);
172
-
173
- })();
174
- </script>
175
- </body>
176
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/modules/Bonus/solar_movie_crop.mp4 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:c73f3fe54283894b06d3898e372c132eee73aac3cfad955458785ee9c5917c2f
3
- size 1473330
 
 
 
 
pages/modules/Copy_Overview.bat DELETED
@@ -1,21 +0,0 @@
1
- copy overview.txt c:.\Module_01
2
- copy overview.txt c:.\Module_02
3
- copy overview.txt c:.\Module_03
4
- copy overview.txt c:.\Module_04
5
- copy overview.txt c:.\Module_05
6
- copy overview.txt c:.\Module_06
7
- copy overview.txt c:.\Module_07
8
- copy overview.txt c:.\Module_08
9
- copy overview.txt c:.\Module_09
10
- copy overview.txt c:.\Module_10
11
- copy overview.txt c:.\Module_11
12
- copy overview.txt c:.\Module_12
13
- copy overview.txt c:.\Module_13
14
- copy overview.txt c:.\Module_14
15
- copy overview.txt c:.\Module_15
16
- copy overview.txt c:.\Module_16
17
- copy overview.txt c:.\Module_17
18
- copy overview.txt c:.\Module_18
19
- copy overview.txt c:.\Module_19
20
- copy overview.txt c:.\Module_20
21
- copy overview.txt c:.\Overview
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/modules/Module_01/Inference Error Types.txt DELETED
@@ -1,24 +0,0 @@
1
- Inference Error Types
2
-
3
-
4
- True False
5
-
6
- Predict Positive True Positive Type 1
7
- (False Positive)
8
-
9
- Predict Negative Type 2 True Negative
10
- (False Negative)
11
-
12
-
13
- ##### Type 1 (False Positive)
14
- Reject Null when true
15
-
16
- Alpha is the probability of committing a Type 1 error
17
-
18
- ##### Type 2 (False Negative)
19
- Reject Null when you should not
20
-
21
- Beta is the probability of committing a Type 2 error
22
-
23
-
24
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/modules/Module_01/Overview.txt DELETED
@@ -1,175 +0,0 @@
1
- Introduction to Statistical Inference
2
- ---
3
- #### What is Statistical Inference
4
-
5
- Statistical inference is the process of using data from a limited set of observations to draw conclusions about a broader situation.
6
- It is like observing a handful of events and then making an educated guess about how things work in general.
7
-
8
- We are going to use the example of rolling two dice and looking at their sum as a foundation for our sample questions.
9
- We are trying to answer the question “Are these dice fair?”.
10
- Let’s go through the process without diving into calculations yet.
11
-
12
- ---
13
- What is Hypothesis Testing?
14
-
15
- This is about make decisions (or inferences) about a population based on sample data
16
-
17
- We set up two competing hypotheses about a population:
18
-
19
- 1) Null hypothesis (baseline assumption - nothing else to be found)
20
- or any other observed effect from sample data is due to chance or random variation
21
-
22
- 2) Alternative hypothesis (opposite from the baseline assumption)
23
- observed sample data differs in a statistically meaningful way from the baseline assumption
24
-
25
- Hypothesis Testing
26
-
27
- A statistical test to gather evidence to either:
28
-
29
- 1) reject the null (baseline) hypothesis in favor of the alternative hypothesis or
30
-
31
- 2) fail to reject the null hypothesis - there's not enough evidence to support the alternative
32
- ---
33
- #### Statistical Inference Walkthrough
34
-
35
- Expander: Hypothesis Setup - Frame Your Question as Two Competing Stories
36
- Base story (“null hypothesis”): The dice are fair
37
- Alternative story: The dice are biased so low or high sums occur more often than with fair dice
38
- End Expander:
39
- Expander: Gather Your Evidence
40
- Decide how many times you will roll the dice.
41
- Keep track of the outcome (the sum) for each roll.
42
- End Expander:
43
- Expander: Summarize What You See
44
- Organize your recorded sums in a simple way (e.g count how often each sum appears)
45
- Look for patterns — do certain sums show up more or less often?
46
- End Expander:
47
- Expander: Compare to What You’d Expect If the Dice Were Fair
48
- Ask yourself: “Do the patterns I see match what typically happens with fair dice?”
49
- Remember even fair dice will show high or low counts in a limited set of rolls
50
- End Expander:
51
- Expander: Judge whether the Differences Are Random or Suggest Bias
52
- Small fluctuations are normal when you roll only a few times
53
- Very large or consistent departures from the fair-dice pattern might indicate bias
54
- End Expander:
55
- Expander: Reach a Conclusion
56
- If your observed pattern looks fair dice allowing for normal ups and downs, you observe the dice are fair
57
- If the pattern is so skewed it seems unlikely, you go with the belief the dice are biased
58
- End Expander:
59
- Expander: Summary of statistical inference
60
- • Start with a clear question (fair vs. biased dice).
61
- • Collect and summarize real-world data (rolls and sums).
62
- • Judge how well that data lines up with the “fair dice” story.
63
- • Make a reasoned decision whether the dice are fair or likely biased
64
- End Expander:
65
-
66
- ---
67
- Image: pages/modules/Module_01/checkpoint_banner.jpg
68
-
69
- Cognitive Checkpoint: [01-01-01]
70
- - Describe what statistical inference is and how it is applied
71
- - Using the example of a coin toss walkthrough the steps for a statistical inference test
72
- - What is your base case (null hypothesis) and what is the alternative
73
- - You flip the coin 100 times to get your sample data.
74
- - What would you expect to see when you compare different samples?
75
- - What would you expect to see with different sample sizes?
76
- End Cognitive Checkpoint:
77
-
78
- ---
79
- We provide a sample walkthrough for a coin toss problem below
80
-
81
- Expander: Frame Your Question as Two Competing Stories
82
- You would like to evaluate whether a coin is properly weighted (fair) and has an equal chance of landing heads or tails.
83
- • Base assumption:
84
- Assuming the coin is fair. After several coin flips you’d expect about half heads and half tails.
85
- • Alternative case:
86
- The coin might actually be unfair (biased) giving heads more or less often than tails.
87
- End Expander:
88
- Expander: Gather Your Evidence
89
- • Decide how many times you will flip the coin for fixed number of times (eg 100 flips)
90
- • Count how many heads you get
91
- • Keep track of the outcome
92
- End Expander:
93
- Expander: Summarize What You See
94
- • Organize your recorded sums in a simple way
95
- • Look for patterns — do certain sums show up more or less often?
96
- End Expander:
97
- Expander: Compare to What You’d Expect If the Coin Was Fair
98
- • Calculate what the outcomes would be if the coin were really fair.
99
- • For example, if you get 60 heads out of 100, ask “How likely is it to see 60 or more heads just by chance with a fair coin?”
100
- • Remember even fair coin will show high or low counts in a limited set of rolls
101
- End Expander:
102
- Expander: Judge whether the Differences Are Random or Suggest Bias
103
- • Define the notion of Surprise
104
- • Pick a cutoff (for example, a 5% chance) for what counts as “surprising.” This would be regarded as an extreme result. If the chance of getting a result as extreme as you did is past that "surprising" cutoff, then you doubt the coin-is-fair assumption.
105
- End Expander:
106
- Expander: Reach a Conclusion
107
- • If your observed pattern looks fair allowing for normal ups and downs, you observe the coin is fair
108
- • If the pattern is so skewed it seems unlikely, you go with the belief the coin is biased
109
- End Expander:
110
- ---
111
- In the last section we asked you to flip a coin 100 times as your sample data. We provided a simulator that does that by rolling two dice (below).
112
- You can select the number of times you wish to roll the dice for your sample size. Note the difference in graphs as you roll more samples.
113
- Note the difference when you increase the number of rolls. We will address why this occurs in subsequent sessions.
114
- HTML: dice_sim.html[1000]
115
- ---
116
- Image: pages/modules/Module_01/checkpoint_banner.jpg
117
-
118
- Cognitive Checkpoint: [01-01-02]
119
- - Describe what statistical inference is and how it is applied
120
- - Using the example of "Do unicorns exist", walk through the steps for a statistical inference test
121
- - Hint: your base case (null hypothesis) is unicorns do not exist and you are trying to prove otherwise
122
- - Can a statistic test even if statistically significant prove a fact (e.g. what are its limitations) ?
123
- End Cognitive Checkpoint:
124
- ---
125
- #### Unicorn Example
126
-
127
- ##### Step 1: State the Null Hypothesis
128
- Default assumption: "Unicorns do not exist" (yes, I am disappointed too)
129
- We assume this is true unless we find strong enough evidence against it.
130
-
131
- ##### Step 2: Collect Evidence
132
- We look for evidence to challenge this assumption.
133
- For example, you might go on a quest, explore forests, check museums, or ask people if they've seen unicorns.
134
-
135
- ##### Step 3: Evaluate the Evidence
136
- Assess whether the evidence strongly supports the idea that unicorns actually exist.
137
-
138
- ##### Step 4: Make a Decision
139
-
140
- If the evidence is not strong enough, you stick with the null hypothesis — “Unicorns do not exist.”
141
- This doesn't prove unicorns absolutely don’t exist, it just means you haven't found good enough evidence to say they do.
142
- If the evidence is very strong — maybe someone finds a real unicorn horn, or a clear photo
143
- — then you reject the null hypothesis and think instead that unicorns might exist.
144
-
145
- ##### Summary
146
-
147
- Hypothesis testing is a process of starting with a default idea (null hypothesis), looking for evidence,
148
- and then deciding whether the evidence is strong enough to reject that idea or not.
149
- It’s like being a detective: you assume something is true until you find good reasons to think otherwise.
150
-
151
- In this case, you start by assuming unicorns don’t exist, and only change your mind if you find convincing proof that they do.
152
- ---
153
- Image: pages/modules/Module_01/astro_unicorn.jpg[512]
154
-
155
- #### Why can't we prove the null hypothesis (Unicorns don't exist)
156
-
157
- Proving a negative claim is inherently difficult because for any observation there are always multiple possible hypotheses that could explain the data, and it's impossible to test all of them.
158
-
159
- Imagine trying to prove there are no unicorns in the world - you'd need to examine every possible location and check every corner of the globe. For hypothesis testing, proving the null hypothesis (no effect) requires examining all possible alternative explanations for the observed data, which is impossible.
160
-
161
- Also for any set of results, there are always multiple hypotheses that could be true. For example, if you observe a small difference between two groups, you might initially think there's no significant difference (null hypothesis). However, other factors like random chance, measurement error, or even a small, true effect might also explain the observed difference.
162
-
163
- In scientific hypothesis testing, the goal isn't to prove the null hypothesis but to gather evidence against it. If the evidence is strong enough, you can reject the null and suggest an alternative explanation.
164
-
165
- Statistical limitations: The null hypothesis is often based on statistical assumptions about populations, and we typically only have data from a sample. This means our conclusions are limited to the sample and may not generalize to the entire population.
166
- ---
167
- HTML: flashcards01.html[800]
168
- ---
169
- Image: pages/modules/Module_01/blastoff.jpg
170
- #### Congratulations on Completing Basic Training
171
-
172
-
173
-
174
-
175
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/modules/Module_01/astro_unicorn.jpg DELETED

Git LFS Details

  • SHA256: 5c5e279c84e0f8107e1eda87024bc4aedd31cbbcce8cbaaf8fd5c0adf8959098
  • Pointer size: 131 Bytes
  • Size of remote file: 289 kB
pages/modules/Module_01/blastoff.jpg DELETED

Git LFS Details

  • SHA256: 1238e0232136a8565afa42335e3d47f22e3f2ae0300f346396995aad9d1fd55e
  • Pointer size: 131 Bytes
  • Size of remote file: 188 kB
pages/modules/Module_01/checkpoint_banner.jpg DELETED
Binary file (29.4 kB)
 
pages/modules/Module_01/dice_sim.html DELETED
@@ -1,175 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Dice Roll Simulator with Mean Line</title>
6
- <style>
7
- body {
8
- font-family: Arial, sans-serif;
9
- margin: 20px;
10
- }
11
- #controls {
12
- margin-bottom: 20px;
13
- }
14
- label {
15
- margin-right: 10px;
16
- }
17
- #histogram {
18
- border: 1px solid #ccc;
19
- background: #fafafa;
20
- }
21
- </style>
22
- </head>
23
- <body>
24
- <div id="controls">
25
- <label for="bias">Bias:</label>
26
- <select id="bias">
27
- <option value="fair">Fair</option>
28
- <option value="low">Biased Low</option>
29
- <option value="high">Biased High</option>
30
- </select>
31
-
32
- <label for="numRolls">Rolls (1–1000):</label>
33
- <input type="number" id="numRolls" value="100" min="1" max="1000">
34
-
35
- <button id="rollBtn">Roll</button>
36
- </div>
37
-
38
- <canvas id="histogram" width="700" height="400"></canvas>
39
-
40
- <script>
41
- (function() {
42
- const canvas = document.getElementById('histogram');
43
- const ctx = canvas.getContext('2d');
44
- const rollBtn = document.getElementById('rollBtn');
45
- const biasSelect = document.getElementById('bias');
46
- const numRollsInput = document.getElementById('numRolls');
47
-
48
- // Weight tables for each bias
49
- const weights = {
50
- fair: [0,1,1,1,1,1,1],
51
- low: [0,6,5,4,3,2,1],
52
- high: [0,1,2,3,4,5,6]
53
- };
54
- // Build CDFs
55
- const cdf = {};
56
- for (let mode in weights) {
57
- const w = weights[mode];
58
- cdf[mode] = [0];
59
- let tot = 0;
60
- for (let i = 1; i <= 6; i++) {
61
- tot += w[i];
62
- cdf[mode][i] = tot;
63
- }
64
- cdf[mode].total = tot;
65
- }
66
-
67
- function sampleDie(mode) {
68
- const r = Math.random() * cdf[mode].total;
69
- for (let face=1; face<=6; face++) {
70
- if (r < cdf[mode][face]) return face;
71
- }
72
- return 6;
73
- }
74
-
75
- function simulate(n, mode) {
76
- const freq = [];
77
- for (let s=2; s<=12; s++) freq[s]=0;
78
- let sumAll = 0;
79
- for (let i=0; i<n; i++) {
80
- const d1 = sampleDie(mode),
81
- d2 = sampleDie(mode),
82
- s = d1 + d2;
83
- freq[s]++;
84
- sumAll += s;
85
- }
86
- const mean = sumAll / n;
87
- return {freq, mean};
88
- }
89
-
90
- function drawHistogram(freq, n, mean) {
91
- // clear
92
- ctx.clearRect(0,0,canvas.width,canvas.height);
93
-
94
- // margins
95
- const m = {top:40, right:20, bottom:40, left:50};
96
- const w = canvas.width - m.left - m.right;
97
- const h = canvas.height - m.top - m.bottom;
98
-
99
- // background panel
100
- ctx.fillStyle = 'rgba(255,255,255,0.8)';
101
- ctx.fillRect(m.left, m.top, w, h);
102
-
103
- // find max freq
104
- let maxF=1;
105
- for (let s=2; s<=12; s++) if ((freq[s]||0) > maxF) maxF = freq[s];
106
-
107
- // axes
108
- ctx.strokeStyle = "#333";
109
- ctx.lineWidth = 1;
110
- ctx.beginPath();
111
- ctx.moveTo(m.left, m.top);
112
- ctx.lineTo(m.left, m.top+h);
113
- ctx.lineTo(m.left+w, m.top+h);
114
- ctx.stroke();
115
-
116
- // bars
117
- const bins = 11;
118
- const barW = (w / bins) * 0.8;
119
- const gap = (w / bins) * 0.2;
120
-
121
- ctx.textAlign = "center";
122
- ctx.fillStyle = "#333";
123
- ctx.font = "14px sans-serif";
124
-
125
- for (let s=2; s<=12; s++) {
126
- const f = freq[s]||0;
127
- const x = m.left + (s-2)*(barW+gap) + gap/2;
128
- const barH = (f/maxF) * (h - 10);
129
- const y = m.top + h - barH;
130
- // draw bar
131
- ctx.fillStyle = "#4a90e2";
132
- ctx.fillRect(x, y, barW, barH);
133
- // count above
134
- ctx.fillStyle = "#000";
135
- ctx.fillText(f, x + barW/2, y - 5);
136
- // sum label below
137
- ctx.fillText(s, x + barW/2, m.top + h + 20);
138
- }
139
-
140
- // y-axis labels
141
- ctx.textAlign = "right";
142
- ctx.fillText("0", m.left - 5, m.top + h);
143
- ctx.fillText(maxF, m.left - 5, m.top + 5);
144
-
145
- // draw mean line
146
- const xMean = m.left + ((mean - 2) / 10) * w;
147
- ctx.strokeStyle = "red";
148
- ctx.lineWidth = 2;
149
- ctx.beginPath();
150
- ctx.moveTo(xMean, m.top);
151
- ctx.lineTo(xMean, m.top + h);
152
- ctx.stroke();
153
- // label mean
154
- ctx.fillStyle = "red";
155
- ctx.textAlign = "center";
156
- ctx.fillText("Mean: " + mean.toFixed(2), xMean, m.top - 10);
157
- }
158
-
159
- rollBtn.addEventListener('click', () => {
160
- let n = parseInt(numRollsInput.value,10);
161
- if (isNaN(n) || n<1) n=1;
162
- if (n>1000) n=1000;
163
- numRollsInput.value = n;
164
-
165
- const mode = biasSelect.value;
166
- const {freq, mean} = simulate(n, mode);
167
- drawHistogram(freq, n, mean);
168
- });
169
-
170
- // initial blank draw
171
- drawHistogram({}, 0, 2);
172
- })();
173
- </script>
174
- </body>
175
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/modules/Module_01/flashcards01.html DELETED
@@ -1,165 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Statistical Inference Flashcards</title>
6
- <style>
7
- body {
8
- font-family: Arial, sans-serif;
9
- background: #f0f0f0;
10
- margin: 0;
11
- padding: 20px;
12
- }
13
- h1 {
14
- text-align: center;
15
- }
16
- .flashcard {
17
- position: relative;
18
- width: 300px;
19
- height: 200px;
20
- margin: 40px auto;
21
- padding: 20px;
22
- background: #fff;
23
- border-radius: 8px;
24
- box-shadow: 0 4px 8px rgba(0,0,0,0.2);
25
- display: flex;
26
- align-items: center;
27
- justify-content: center;
28
- text-align: center;
29
- font-size: 18px;
30
- cursor: pointer;
31
- user-select: none;
32
- }
33
- .checkmark {
34
- position: absolute;
35
- top: 10px;
36
- right: 10px;
37
- font-size: 24px;
38
- color: gray;
39
- cursor: pointer;
40
- }
41
- #controls {
42
- text-align: center;
43
- margin-top: 20px;
44
- }
45
- #controls button {
46
- padding: 8px 16px;
47
- margin: 0 10px;
48
- font-size: 16px;
49
- }
50
- #controls button:disabled {
51
- opacity: 0.5;
52
- cursor: not-allowed;
53
- }
54
- </style>
55
- </head>
56
- <body>
57
- <div id="flashcard" class="flashcard">
58
- <div id="checkmark" class="checkmark">✔</div>
59
- <div id="content"></div>
60
- </div>
61
-
62
- <div id="controls">
63
- <button id="prev">Previous</button>
64
- <button id="next">Next</button>
65
- </div>
66
-
67
- <script>
68
- // 10 sample flashcards
69
- const flashcards = [
70
- {
71
- question: "What is a null hypothesis or base case?",
72
- answer: "A statement that there is no effect or difference, which we test against alternative evidence.",
73
- correct: false
74
- },
75
- {
76
- question: "What is a p-value?",
77
- answer: "The probability of observing data at least as extreme as yours if the null hypothesis is true.",
78
- correct: false
79
- },
80
- {
81
- question: "What does a confidence interval tell you?",
82
- answer: "A range of values where we believe the true parameter lies, with a certain level of confidence (e.g., 95%).",
83
- correct: false
84
- },
85
- {
86
- question: "What is a Type I error?",
87
- answer: "Incorrectly rejecting the null hypothesis when it is actually true (a false positive).",
88
- correct: false
89
- },
90
- {
91
- question: "What is a Type II error?",
92
- answer: "Failing to reject the null hypothesis when it is actually false (a false negative).",
93
- correct: false
94
- },
95
- {
96
- question: "What is the difference between one-tailed and two-tailed tests?",
97
- answer: "One-tailed tests check for an effect in a specific direction; two-tailed tests check for any effect in either direction.",
98
- correct: false
99
- },
100
- {
101
- question: "What are the steps used to frame a statistical inference problem?",
102
- answer: "1) Frame question as two competing theories 2) Gather evidence 3) Summarize what you see 4) Compare to Expectations 5) Is this statistically probable? 6) Are differences random or biased 7) Conclude (Fail to Reject or Reject)",
103
- correct: false
104
- }
105
- ];
106
-
107
- let currentIndex = 0;
108
- let showAnswer = false;
109
-
110
- const cardEl = document.getElementById('flashcard');
111
- const contentEl = document.getElementById('content');
112
- const checkEl = document.getElementById('checkmark');
113
- const prevBtn = document.getElementById('prev');
114
- const nextBtn = document.getElementById('next');
115
-
116
- function renderCard() {
117
- const card = flashcards[currentIndex];
118
-
119
- if (showAnswer) {
120
- contentEl.textContent = card.answer;
121
- checkEl.style.display = 'none';
122
- } else {
123
- contentEl.textContent = card.question;
124
- checkEl.style.display = 'block';
125
- checkEl.style.color = card.correct ? 'green' : 'gray';
126
- }
127
-
128
- prevBtn.disabled = currentIndex === 0;
129
- nextBtn.disabled = currentIndex === flashcards.length - 1;
130
- }
131
-
132
- // Flip card on click (except when clicking the checkmark)
133
- cardEl.addEventListener('click', () => {
134
- showAnswer = !showAnswer;
135
- renderCard();
136
- });
137
-
138
- // Toggle correct mark
139
- checkEl.addEventListener('click', e => {
140
- e.stopPropagation(); // don't also flip the card
141
- flashcards[currentIndex].correct = !flashcards[currentIndex].correct;
142
- renderCard();
143
- });
144
-
145
- prevBtn.addEventListener('click', () => {
146
- if (currentIndex > 0) {
147
- currentIndex--;
148
- showAnswer = false;
149
- renderCard();
150
- }
151
- });
152
-
153
- nextBtn.addEventListener('click', () => {
154
- if (currentIndex < flashcards.length - 1) {
155
- currentIndex++;
156
- showAnswer = false;
157
- renderCard();
158
- }
159
- });
160
-
161
- // Initial display
162
- renderCard();
163
- </script>
164
- </body>
165
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/modules/Module_02/Overview.txt DELETED
@@ -1,122 +0,0 @@
1
- Next Steps - Adding Calculations
2
- ---
3
- In our introductory module, we discussed the concept of statistical inference We will expand on the topic in this section
4
- adding more terminology and also the mathematic calculations that are required to validate a problem statistically.
5
- Image: pages/modules/Module_02/astro_float.jpg[1024]
6
- ---
7
- Image: pages/modules/Module_02/ideal_prob_fair_coin.jpg[947]
8
- Let’s get back to our coin toss example. The graph above represents an ideal sample that one would expect if you tossed a fair coin 20 times.
9
- Given that the probability of heads (or tails) is 50% if the coin is fair, one would expect 50% * 20 = 10 as the most likely count after 20 coin tosses with higher or lower counts falling from that level on both sides of the curve in a symmetrical pattern as shown by the curve.
10
- ---
11
- Image: pages/modules/Module_02/ideal_prob_fair_coin_ge_13.jpg[925]
12
- So what are the chances of getting 13 or greater heads after tossing a fair coin 20 times? This area is shown with the green bars.
13
- To calculate we add up each bar to get a total. Because we are only dealing with one-tail of the curve, this is a “one-tail” calculation,
14
- the right tail that denotes whether we are greater or equal to a certain value (13 heads).
15
- ---
16
- We can calculate this in R using the binomial function and adding (among many other ways) the probability for each number from 13 (hurdle rate) to 20 (max throws).
17
- = dbinom(Number of Heads, Total Throws, Probability)
18
-
19
- Press the green bar to run the program and after a few seconds should see the following answer that the probability is
20
- approximately 13.2% written as "[1] 0.131588"
21
-
22
- R Code:
23
- dbinom(13,20,0.5)+ dbinom(14,20,0.5)+ dbinom(15,20,0.5)+ dbinom(16,20,0.5)+ dbinom(17,20,0.5)+ dbinom(18,20,0.5)+ dbinom(19,20,0.5)+ dbinom(20,20,0.5)
24
- End R Code:
25
-
26
- ---
27
-
28
- Image: pages/modules/Module_02/ideal_prob_fair_coin_ge_13.jpg[925]
29
-
30
- So what are the chances of getting 7 or FEWER heads after tossing a fair coin 20 times? This area is shown with the green bars.
31
- To calculate we add up each bar to get a total. Because we are only dealing with one-tail of the curve, this is a “one-tail” calculation,
32
- the right tail that denotes whether we are greater or equal to a certain value (13 heads).
33
- ---
34
- We can calculate this in R using the binomial function and adding (among many other ways) the probability for each number from 0 (minimum) to 7 (hurdle rate).
35
- = dbinom(Number of Heads, Total Throws, Probability)
36
-
37
- Press the green bar to run the program and after a few seconds should see the following answer that the probability is
38
- approximately 13.2% written as "[1] 0.131588"
39
-
40
- This is identical to 13 or greater showing how the curve is symmetrical around the mean of 10
41
-
42
- R Code:
43
- dbinom(0,20,0.5)+dbinom(1,20,0.5)+ dbinom(2,20,0.5)+ dbinom(3,20,0.5)+ dbinom(4,20,0.5)+ dbinom(5,20,0.5)+ dbinom(6,20,0.5)+ dbinom(7,20,0.5)
44
- End R Code:
45
-
46
-
47
- ---
48
- We can calculate this in R using the binomial function and adding (among many other ways) the probability for each number from 13 (hurdle rate) to 20 (max throws).
49
- = dbinom(Number of Heads, Total Throws, Probability)
50
-
51
- Press the green bar to run the program and after a few seconds should see the following answer:
52
-
53
- [1] 0.131588
54
-
55
- that the probability is approximately 13.2%
56
-
57
-
58
- R Code:
59
- dbinom(13,20,0.5)+ dbinom(14,20,0.5)+ dbinom(15,20,0.5)+ dbinom(16,20,0.5)+ dbinom(17,20,0.5)+ dbinom(18,20,0.5)+ dbinom(19,20,0.5)+ dbinom(20,20,0.5)
60
- End R Code:
61
-
62
- ---
63
- Image: pages/modules/Module_03/under_construction.jpg[1024]
64
- Exciting and engaging ASCEND content is coming soon
65
- ---
66
- #### Correctly use and interpret p-values in hypothesis testing.
67
-
68
- Below is a step-by-step recipe for using and interpreting p-values, followed by a simple “coin-flip” example.
69
-
70
- Formulate hypotheses
71
- • H₀ (null): The effect or difference you’re testing is zero (e.g. “coin is fair,” p = 0.5).
72
- • H₁ (alternative): The effect goes in a specific direction (one-tailed) or differs in either direction (two-tailed).
73
-
74
- Choose a significance level α
75
- • Common choices: 0.05, 0.01.
76
- • This is your acceptable probability of a Type I error (rejecting H₀ when it’s true).
77
-
78
- Collect data & compute a test statistic
79
- • E.g. for coin‐flips, count the number of heads X in n flips.
80
- • Under H₀, X∼Binomial(n, 0.5).
81
-
82
- Compute the p-value
83
- • Definition: p-value = P(observing a result at least as extreme as yours, assuming H₀ is true).
84
- • For a two-tailed coin-fairness test with n=100 and observed X=60:
85
- – P(X≥60 or X≤40) = 2·P(X≥60) ≃ 2·0.028 = 0.056.
86
- • For a one-tailed test (H₁: coin is biased toward heads), p-value = P(X≥60) ≃ 0.028.
87
-
88
- Compare p-value to α and decide
89
- • If p ≤ α → reject H₀ (“statistically significant”).
90
- • If p > α → fail to reject H₀ (“not statistically significant”).
91
-
92
- Interpret correctly
93
- • A p-value of 0.028 means: “If the coin really were fair, there’s a 2.8% chance of getting 60 or more heads in 100 flips.”
94
- • It is NOT the probability that H₀ is true.
95
- • “Failing to reject H₀” does not prove H₀; it just means the data aren’t strong enough to rule it out at your chosen α.
96
-
97
- –––
98
- #### Coin-flip example in full:
99
-
100
- H₀: coin is fair (p=0.5)
101
- H₁ (two-tailed): p≠0.5
102
-
103
- α = 0.05
104
-
105
- Data: n=100 flips, observed X=60 heads.
106
-
107
- Under H₀, X∼Binomial(100,0.5)
108
-
109
- P(X≥60) = sum_{k=60}^{100} (100 choose k)·0.5¹⁰⁰ ≃ 0.028
110
- Two-tailed p-value = 2·0.028 = 0.056
111
-
112
- Decision: 0.056 > 0.05 → fail to reject H₀ at α=0.05.
113
-
114
- Conclusion: The data do not provide strong enough evidence (at the 5% level) to conclude the coin is unfair.
115
- However, since p is close to 0.05, you might collect more data before making a final judgment.
116
-
117
- –––
118
- #### Key reminders:
119
- • p-value quantifies how surprising your data are under H₀, not the probability H₀ is true.
120
- • Always state your α level in advance.
121
- • Avoid “p-hacking” (trying multiple tests until you get p<α).
122
- • Report exact p-values (e.g. p=0.028), not just “p<0.05.”
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/modules/Module_02/astro_float.jpg DELETED
Binary file (67.8 kB)