W01 課程介紹

2025-09-10-Wednesday 14:10-17:00 林師模教授 shihmolin@gmail.com (助教Sopia張桂鳳)


| syllabus | phd16-QM(I) | Review of Statistics: Prof.'s: Basic Probability Concepts | 統計自習筆記 |

課本: Principles of Econometrics, 5th Edition | 筆記: GoogleDoc
作業: W03 Asig#1 | WxxAsig#2 | WxxAsig#3 |
考試: Exam | Midterm | Final |
同學:11304601劉珮彤, 11304625茉莉(India), (遇Romi同學-說統計很好的-Bisyri Effend想參加2026_LFHintern)

本週在多倫多,請假!

W02 Review of Statistics

2025-09-17-Tuesday 14:00-17:00 林師模教授


Review of Statistics: Prof.'s: Basic Probability Concepts |
1.問? what's difference betweeen: standardizqtion and nomorlization
2.問? 為何需要standardization?
remove unit
confine the range, in -1<= sd <=1
esay to compare: for the unit has been removed

-注意frequently use公式: var(a+cX) = c^2var(X) 因為 a 是constant 沒有var (coefficient 係數)

-E[(X-EX) (Y-EY)] --> +or- will know the relationship of X and Y, that's call: covarance

雖然X-EX 或但是看不出來strength 這是因為 unit改變就會改變數字。如果想知道strength 強度,可以先做standarlilzation以除去unit。
所以可以用: Measure / SD
公式: Z = (Xi - EX )/S.D.(X)

-Cov(X,Y)=E[(X-EX) (Y-EY)] = {Sumation (X-EX) (Y-EY)} / n

看2,34 Correlation
is a pure number faling between -1 and 1

*注意 要在你的excel加上 增益集-分析工具箱-
這樣你按 資料時 右邊就會出現 「資料分析」這工具。
=自己用lireoffice和Googlesheet 試做個 x體重/y身高 資料表,然後叫他算出 correlation number 相關係數。
這工具還可有其他分析工具,但更複雜的要用Eviews之類軟體來做。

The coverse is not true. 這句話 Why?

Y=a+bX 時 cor = 1
但 如果是個圓的話 cor=0 但 X Y 應該是有關係 but why we got o relationship
因為只能測量 linear relationship 而如果你碰到non-linear relationship時,隨然 cor=0 但是X Y其實是有non-linear relationship的

-2.37
-2.38 記住 weighted sum of rendom variables: 的公式,很重要。常要用到。

問: 為何要sandardization?
答: 因為不可能弄無線多個distribution table, 如果把mean設為0 把sd設為1 那就只要一張table就好了!
probability ditribution table =
見 2.41 只要convaert 原來的Y變成a 做出 Standard normal

2.44 Chi-Square distribution
可細分為:Goodness of fit「適配度檢驗」, Independent 「獨立性檢驗」, Homogeneity 「同質性檢驗」三種。
吸煙與肺癌的研究因為是從兩個獨立的群體(病例與對照)開始,並比較它們的吸煙習慣分布,所以它在統計學上屬於同質性檢驗的應用範疇。
2.45 Student-t distribution 我們通常用sample (very close normal distribution)
2.46 F statistic distribution (F是偏左的 distribution 都是正的-因都平方, 右邊長尾)
i-learning_2.0

W03 --本週課目標題--

2025-09-24-Tuesday 14:00-17:00 林師模教授


★ ■ ▲
wha is the steops of hypothesis

■ Hypothesis testing, ■ANOVA(Analysis of variance) 變異數分析;
ChatGPT說明 The steps of hypothesis
例如: 100學生數學成績,內有分N M S 北中南三區學生
1.what question? is region -> effect of math score.
2.H0: μ1=μ2=μ3 (μN=μM=μS)
H1: μ1≠μ2≠μ3 either one ≠
3.★ select Test Statistic 檢定統計量 -找出critical value. (to know the test statistic)
if the statistic not greater than critical value, fall in acceptance area, means that you can not reject the H0.
- 如何找出test方法 經驗/自己推導-想辦法試驗/如果你不知道-you can develop by yourself or even you can publish/ or use other people’s way, to know how others usely do/.
- 多看別人的,多看文章,多看案例.
- ★ need to know what would be the porbability distribution (with your test)
4. Collect Data and Calculate the Test Statistic
- need dicide alpha: significant value first (0.05 or 0.01, 0.10..)
consulting (F) talbe, then you can find out the coreponding critical value.
★ Alpha value 的意義: TypeI error: Ho is true the probability of rejecting the null only 5% (alpha) 你決定了alpha值,就是你決定可能犯了型1錯誤的機率,在alpha值之內。

  1. Find the Critical Value(s) or p-value
  2. Make a Decision
  3. State the Conclusion

■ANOVA(Analysis of variance)
if we have three or more normal distribution, and we would like to know whether their means are the same or not?
比如剛剛那來自三個地區的100個學生,是否 H 可以求出一個total mean = μ
對任一個 (Yij-μ) = (Ynj-μj) + (μj-μ) 對所有n點想要總和,需要先square以免被相互抵銷
所以先 sauare (Yij-μ) 全部加總起來

SST (sum square total) = SSE (error sum of square 你自己母體的差) + SSB (between group -sum square) 有時SSE 也叫做 SSW (Within group seim square 的意思)
SST=SSE+SSB
如果各組差異大,那麼SSB會變大。 所以如果兩邊都除以SST 這樣就成了
1= (SSE/SST) + (SSB/SST) 假設 這是 1=0.3 + 0.7 那你怎麼知道 0.7有沒大過critical value?
如果各組差異大,那麼SSB會變大。 所以如果兩邊都除以SST 這樣就成了
1= (SSE/SST) + (SSB/SST) 假設 這是 1=0.3 + 0.7 那你怎麼知道 0.7有沒大過critical value?

Gemini20250924
SST(sum square total), SSE (error sum of square), SSB (between group -sum square)
設SST=SSE+SSB 所以 1= (SSE/SST) + (SSB/SST)
假如 SSE=0.3 而 SST=0.7 那要怎麼知道 0.7有沒大過critical value?

F Statistical calculation step:
F 統計量的計算公式通常是指變異數分析(ANOVA)中的 F = MSB / MSW,
其中MSB 是組間平均平方(Mean Square Between),
MSW 是組內平均平方(Mean Square Within),
F 值用於檢定多個母體平均數是否完全相同。

■ wiki F檢定
F 統計量的計算步驟
計算組間平方和(SSB):: 衡量不同組別之間的平均變異。
計算組內平方和(SSW):: 衡量每個組別內部數據點與該組平均數之間的變異。
計算自由度(df)::
組間自由度(dfB) = 組別數量- 1
組內自由度(dfW) = 總樣本數- 組別數量 (但老師在這個例題,用的是n-1 不是n-group number 因為是SST,但注意📌)
計算平均平方(MS):: 組間平均平方(MSB) = SSB / dfB
組內平均平方(MSW) = SSW / dfW
計算F 值:: F = MSB / MSW。
應用情境
變異數分析(ANOVA):: 這是F 統計量最常被使用的情境,用於比較三個或三個以上群體平均數的差異。
變異數比率檢定:: F 檢定也可以用於檢定兩個母體變異數是否相等。
如何理解F 值
F 值是組間變異與組內變異的比例。
較大的F 值表示組間的平均差異比組內的平均差異大,這暗示著群體平均數之間存在顯著差異。

📌注意: 正式用的是SSB /SSW 不是SST (SSW/m3 這個m3 就是df 就是 n-組別數量 )

F = (SSB/(J-a)) / (SSW/(n-J)) 老師說:根據經驗 n=100 J=3 時 Falpha .=.3 但如果J=5 可能小於3, 如果J=10 會更小。 不信去查F表。 F表最上面那行是group的df, 左邊直行是n的df。


老師要教。怎樣用excel去做F test data資料 –> data analysis資料分析 單因子變異數分析 –> by row 逐列: @回家用googlesheet 做看看。

ANOVA如果有 2 factor(如男女)但 sample數都一樣,叫做balanced table如果 sample數不一樣就是imbalanced table (如果每一類只有1個sample data)叫做non-repetitions experiment非重複實驗 HomeWork:
老師出一個作業下週三以前sumit report, 題目是: 自己設計question自己收集data 做一個two factor ANOVA data 需要是repetition data.

我去年學了兩個學期的Econometrics,作業交了、考試也過了,但問題還是很多,覺得好多地方都迷迷糊糊的不踏實。
這課會用到大量的統計、小部份的微積分推導,是好的學習機會。因此今年自動重修,準備重新進入頭痛的週三下午模式。
我們以前唸書先要買課本,有時還要買參考書。
現在的世界,很多課本、參考書都可以免費取得,如果你需要紙本的,再特別去買。
這是我們的課本,因為是免費的,所以也分享給各位。
Principles of Econometrics, 5th Edition
https://arm.ssuv.uz/frontend/web/books/643103c2ad0af.pdf
老師講得飛快,今天要講第二章
The Simple Linear Regression Model
稍不注意(比如沒有人提問、沒有討論)有時一週就把一章講完了(最多兩週),因此最好提早來先看例題,如果看不懂等一下就可以提出來問,拖慢腳步。

去年聽這個課,第1個小時好像懂,第2個小時好像不大懂,第3個小時一堆不懂。今年稍微好一點。
好在我有Gemini和ChatGPT還有Grok幫忙。一邊聽,一邊請教AI。

唉😢奇怪!今天老師不講OLS直接講■Hypothesis testing, ■ANOVA(Analysis of variance)。

老師出作業, 下週三以前要submit report, 題目是:
自己設計Question,自己收集data,然後做出一個: two factor ANOVA (data 需要是repetition data.)交報告。
Format for report: pdf file, less than 2 pages. 1.Descript your question. 2.Descript your variables and data. 3.ANOVA result. 4.Conclusions.

要回家拜託AI了 (這就是為什麼我要交錢給ChatGPT和Gemini)

我跟Gmini討論用Eviews8.1做ANOVA的過程
我跟ChatGPT討論用python做ANOVA的過程

W04 Chp02-The Simple Linear Regression Model

2025-10-01-Tuesday 14:00-17:00 林師模教授


Chp02|
1.卡方檢驗吸煙與肺癌 Googlesheet- 這個研究因為是從兩個獨立的群體(病例與對照)開始,並比較它們的吸煙習慣分布,所以它在統計學上屬於同質性檢驗的應用範疇。 #statistics #phd
2.高點研究所 研究所碩士班歷屆考古題 #statistics
3.NotebookLM 肥料效益差異的F檢定與事後分析


ChatGPT20250924 關於迴歸模型Regression model:請解釋估計量estimator和估計值estimate之間的區別,以及為什麼最小平方法估計量least squares estimators是隨機變量,而最小平方法估計值不是。
經典線性迴歸假設
1.線性模型:
2.誤差項的期望值為 E[Ui]=0
3.誤差項變異數齊一 var(Ui)=δ^2
4.誤差項不相關 Cov(Ui,Uj)=0, i≠j
5.解釋變數不完全共線
Classical Linear Regression Assumptions
1. Linear Model:
2. The expected value of the error term is E[Ui] = 0
3. The variance of the error terms is uniform (var(Ui) = δ^2)
4. The error terms are uncorrelated (Cov(Ui,Uj) = 0, i ≠ j)
5. The explanatory variables are not completely collinear.
Youtube Introduction To Ordinary Least Squares With Examples
「珂学原理」No.94什么是最小二乘估计?它解决什么问题?
- If you are rusty or uncertain about probability concepts, see the Probability Primer and Appendix B at the end of this book for a comprehensive review.


The Simple Linear Regression Model
Why?
simple: one dependent variable has only one independent variable.
Linear: relationship: the equation show as a line.
regression: (regress vs. progress 進步) use the already data to look back the relationship. observe the relationship of data. useing the data in the past to generate a line to look back the relationship. model: from emperical phenomeno to abstract the idea, make specification of a relationship.

例如: y: expenditure x:income
y=f(x) base on economic model
we might be able to build up a true function of the model by collecting empirical data of observation.

so we may say: y=β1 + β2 x (this is a emperical model)
true value like (xi, yi) may differenct from (xhat, yhat) which is on the regression line. so we have turn the model to: yi= β1 + β2 xi + ei (this is a econometric model) we need to use true data to estimate the β1,β2,ei parameters

yi= β1 + β2 xi + ei
y: dependent, explained被解釋, regressant, response variable
x: independet, explanatory, regressor variable
ei: erro term, residule(after we estimate model),
β1 and β2: regression coefficient, parameter
β1: intercept, constant
β2: slope (=dyi/dxi = deribative 導數 =when detax change one unit, deaty change ratio = marginal effect 邊際效應 = 當你有一個exiting situation 增加一個unit叫做 marginal unit)
這個existing situation很重要,因為可能是個critical point, 越過這個existing situation狀況可能改變,但marginal effect不隨狀況改變。
所以在這裡的modle 這個β1是個constant 和β2 是個(線性的)slope 都不會變,是個marginal effect。
注意:如果是個曲線 那麼slope 會改變,就不能算是marginal effect。
β2=dy/dx 是個marginal effect

econometric model = regression model
for every econometric model we always needs an Assumptions.
there are many Assumptions, we will look at it one by one.


今日的Quick Review:
example: 2 variable: Income=x, Expenditure=y
more income will expend more money, so there is a linear relationship. so we can set up a model:
yi= β1 + β2 xi
the distance from xi to the line we call it erro term (ei) thus come out the econometic model:
yi= β1 + β2 xi + ei
想找出β1,β2就要根據assumption 的定義
1.linear relationship
2.E(ei | xi) =0
3.Cov(xi,ei | xi) =0
4.Cov(ei,ej | xi) =0
5.xi is nonstotastic
6.ei~ N(0,δ^2)

find out the best line: estimation (estimate a value for model ): least square idea is let the total distance from data point to the line should be smallest: the sumation of all erro term shoud be minimized. in case of the summation became 0, we should square it then do the summation.
after you summation of square will became a quadratic line, then we should do firest derivative to find out the tangent line. 得出公式!!!!!!! get regression model.


老師展示example: 用Eviews:
food.wfi
先選ubcome再ctrl+foodexp open by group

Quick>estimate equation> [food_exp c income ] method: LS-least squares
OK>就可得到estimate result

W05 --本週課目標題--

2025-10-08-Tuesday 14:00-17:00 林師模教授


講義: Ch-02 Simple Linear Regression Model
講義: Ch-03 Interval Estimation and Hypothesis Testing

W06 --本週課目標題--

2025-10-15-Tuesday 14:00-17:00 林師模教授


W07 --本週課目標題--

2025-10-22-Tuesday 14:00-17:00 林師模教授


W08 --本週課目標題--

2025-10-29-Tuesday 14:00-17:00 林師模教授


W09 --本週課目標題--

2025-10-05-Tuesday 14:00-17:00 林師模教授


Backup Data 其他參考資料


Book | Data Miming | Data Science for Business |
URL | Kaggle | 彭明輝教授
1.演講Youtube: 期刊論文閱讀技巧
2.演講Youtube: 研究生的核心能力 ─ 從文獻回顧到批判與創新 │Future Faculty Talk

▼1 WHAT IS INFORMATION MANAGEMENT?

WHAT IS INFORMATION MANAGEMENT?
1.ANIMATION FOR PLATONWHAT IS INFORMATION MANAGEMENT? wearesynkro 2014。
2. Information Management BasicsCommunity IT Innovators 2018。
3.(IM) Information Management JuanIT 2021。有一系列lecture
4.The 5 Components of an Information System COTC A.R.C. 2015。


▼2 折疊2

折疊2
  1. Lorem ipsum dolor sit amet.
  2. Lorem ipsum dolor sit amet.



ab