Copyright © 2011 Pearson Education, Inc. Linear Patterns Chapter 19.

Slides:



Advertisements
Similar presentations
1 Econometrics. 2 Ch1 The nature and scope of Econometrics Y: dependent var. => effect ( 果 ) X 1, …X k : independent var. => cause ( 因 ) Ch2-Ch5:Review.
Advertisements

03/19/2003 Week #4 江支弘 Chapter 4 Making Predictions: Regression Analysis.
1 政大公企中心產業人才投資課程 -- 企業決策分析方法 -- 黃智聰 政大公企中心產業人才投資課程 課程名稱:企業決策分析方法 授課老師:黃智聰 授課內容: 企業決策分析之報告結果與計量模型型式 之選擇 參考書目: Hill, C. R., W. E. Griffiths, and G. G. Judge,
Chapter Four Parameter Estimation and Statistical Inference.
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 肆 資料分析與表達.
Chapter 10 馬可夫鏈 緒言 如果讀者仔細觀察日常生活中所發生的 諸多事件,必然會發現有些事件的未來 發展或演變與該事件現階段的狀況全然 無關,這種事件稱為獨立試行過程 (process of independent trials) ;而另一些 事件則會受到該事件現階段的狀況影響。
第七章 抽樣與抽樣分配 蒐集統計資料最常見的方式是抽查。這 牽涉到兩個問題: 抽出的樣本是否具有代表性?是否能反應出母體的特徵?
Section 1.2 Describing Distributions with Numbers 用數字描述分配.
社研法助教課, 2007/04/11 如何閱讀 SPSS 圖表 (迴歸分析篇) By 黃昱珽. 小考題目 大華用 SPSS 得到以下的資料: (圖表見下面) 說明 : BABYMORT = 嬰兒死亡率, GDP_CAP = 一國國民生產毛額, LIT_FEMA = 女性識字率。 資料來源 : 聯合國,
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 參 實驗法.
1 Simple Regression ( 簡單迴歸分析 ) Social Research Methods 2109 & 6507 Spring, 2006 March 8, 9, 13, 2006.
1 政治大學財政所與東亞所選修 -- 應用計量分析 -- 中國財政研究 黃智聰 政治大學財政所與東亞所選修 課程名稱:應用計量分析 -- 中國財政研究 授課老師:黃智聰 授課內容: 簡單線性迴歸模型: 共線性與虛擬變數 參考書目: Hill, C. R., W. E. Griffiths, and G.
©Ming-chi Chen 社會統計 Page.1 社會統計 第十講 相關與共變. ©Ming-chi Chen 社會統計 Page.2 Covariance, 共變量 當 X, Y 兩隨機變數不互為獨立時,表示 兩者間有關連。其關連的形式有很多種, 最常見的關連為線性的共變關係。 隨機變數 X,Y.
Review of Chapter 3 - 已學過的 rules( 回顧 )- 朝陽科技大學 資訊管理系 李麗華 教授.
消費者物價指數反映生活成本。當消費者物價指數上升時,一般家庭需要花費更多的金錢才能維持相同的生活水準。經濟學家用物價膨脹(inflation)來描述一般物價持續上升的現象,而物價膨脹率(inflation rate)為物價水準的變動百分比。
Section 2.3 Least-Squares Regression 最小平方迴歸
1 政治大學公企中心必修課 -- 社會科學研究方法(量化分析) -- 黃智聰 政治大學公企中心必修課 課程名稱:社會科學研究方法(量化分析) 授課老師:黃智聰 授課內容: 質化的及有限的因變數模型 參考書目: Hill, C. R., W. E. Griffiths, and G. G. Judge,
STAT0_sampling Random Sampling  母體: Finite population & Infinity population  由一大小為 N 的有限母體中抽出一樣本數為 n 的樣 本,若每一樣本被抽出的機率是一樣的,這樣本稱 為隨機樣本 (random sample)
第 4 章 迴歸的同步推論與其他主題.
Structural Equation Modeling Chapter 7 觀察變數路徑分析=路徑分析 觀察變數路徑分析.
STAT0_corr1 二變數的相關性  變數之間的關係是統計研究上的一大目標  討論二分類變數的相關性,以列聯表來表示  討論二連續隨機變數時,可以作 x-y 散佈圖觀察它 們的關係強度  以相關係數來代表二者關係的強度.
Section 2.2 Correlation 相關係數. 散佈圖 1 散佈圖 2 散佈圖的盲點 兩座標軸的刻度不同,散佈圖的外觀呈 現的相聯性強度,會有不同的感受。 散佈圖 2 相聯性看起來比散佈圖 1 來得強。 以統計數字相關係數做為客觀標準。
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 肆 資料分析與表達.
基礎物理總論 基礎物理總論 熱力學與統計力學(三) Statistical Mechanics 東海大學物理系 施奇廷.
1 政治大學東亞所選修 -- 計量分析與中國大陸研究黃智聰 政治大學東亞所選修 課程名稱:計量分析與中國大陸研究 (量化分析) 授課老師:黃智聰 授課內容:時間序列與橫斷面資料的共用 參考書目: Hill, C. R., W. E. Griffiths, and G. G. Judge, (2001),
Monte Carlo Simulation Part.2 Metropolis Algorithm Dept. Phys. Tunghai Univ. Numerical Methods C. T. Shih.
1 Part IC. Descriptive Statistics Multivariate Statistics ( 多變量統計 ) Focus: Multiple Regression ( 多元迴歸、複迴歸 ) Spring 2007.
2009fallStat_samplec.i.1 Chap10 Sampling distribution (review) 樣本必須是隨機樣本 (random sample) ,才能代表母體 Sample mean 是一隨機變數,隨著每一次抽出來的 樣本值不同,它的值也不同,但會有規律性 為了要知道估計的精確性,必需要知道樣本平均數.
1 政治大學財政所與東亞所選修 -- 應用計量分析 -- 中國財政研究 黃智聰 政治大學財政所與東亞所選修 課程名稱:應用計量分析 -- 中國財政研究 授課老師:黃智聰 授課內容: 簡單線性迴歸模型:報告結果 與選擇函數型式 參考書目: Hill, C. R., W. E. Griffiths, and.
信度.
1 政治大學公企中心必修課 -- 社會科學研究方法(量化分析) -- 黃智聰 政治大學公企中心必修課 課程名稱:社會科學研究方法(量化分析) 授課老師:黃智聰 授課內容: 簡單線性迴歸模型: 共線性與虛擬變數 參考書目: Hill, C. R., W. E. Griffiths, and G. G.
4 CHAPTER 需求與供給. 4 CHAPTER 需求與供給 C H A P T E R C H E C K L I S T 學習本章後,您將能: 區別需求量與需求的差異,瞭解需求的決定因素 1 區別供給量與供給的差異,瞭解供給的決定因素 2 解釋需求與供給如何決定市場價格與數量,以及需求與供.
1 開南大學公管所與國企所合開選修課 -- 量化分析與應用 -- 黃智聰 開南大學公管所與國企所合開選修課 課程名稱:量化分析與應用 授課老師:黃智聰 授課內容: 簡單線性迴歸模型: 共線性與虛擬變數 參考書目: Hill, C. R., W. E. Griffiths, and G. G. Judge,
Chapter 8 消費可能性 偏好 選擇 Part 3 家庭的選擇
1 政大公企中心產業人才投資課程 -- 企業決策分析方法 -- 黃智聰 政大公企中心產業人才投資課程 課程名稱:企業決策分析方法 授課老師:黃智聰 授課內容: 質化因素在企業決策分析之重要性 參考書目: Hill, C. R., W. E. Griffiths, and G. G. Judge, (2001),
選舉制度、政府結構與政 黨體系 Cox (1997) Electoral institutions, cleavage strucuters, and the number of parties.
: Multisets and Sequences ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11023: Multisets and Sequences 解題者:葉貫中 解題日期: 2007 年 4 月 24 日 題意:在這個題目中,我們要定義.
政治大學公企中心必修課-- 社會科學研究方法(量化分析)--黃智聰
Structural Equation Modeling Chapter 1 模式存在與否之需,見仁見智; 但是,人無模式,就無決策 SEM 概論.
觀測量的權 權的觀念與計算.
公用品.  該物品的數量不會因一人的消費而受到 影響,它可以同時地被多人享用。 角色分配  兩位同學當我的助手,負責:  其餘各人是投資者,每人擁有 $100 , 可以投資在兩種資產上。  記錄  計算  協助同學討論.
1 政治大學國務院國安碩專班選修課 -- 社會科學研究方法(量化分析) -- 黃智聰 政治大學國務院國安碩專班選修課 課程名稱:社會科學研究方法(量化分析) 授課老師:黃智聰 授課內容: 簡單線性迴歸模型: 共線性與虛擬變數 參考書目: Hill, C. R., W. E. Griffiths, and.
變異數分析 迴歸分析 因素分析 區別分析 集區分析
Section 4.2 Probability Models 機率模式. 由實驗看機率 實驗前先列出所有可能的實驗結果。 – 擲銅板:正面或反面。 – 擲骰子: 1~6 點。 – 擲骰子兩顆: (1,1),(1,2),(1,3),… 等 36 種。 決定每一個可能的實驗結果發生機率。 – 實驗後所有的實驗結果整理得到。
演算法 8-1 最大數及最小數找法 8-2 排序 8-3 二元搜尋法.
Chapter 6 線性規劃 緒言 如何在有限的經濟資源下進行最有效的調配與 選用,以求發揮資源的最高效能。此問題愈來 愈受到重視,也就是以最低的代價,獲取最大 的效益。 茲列舉如下: – 決定緊急設備與人員的地點,使反應時間最短化。 – 決定飛機、飛行員、地勤人員的飛航最佳日程安排。
845: Gas Station Numbers ★★★ 題組: Problem Set Archive with Online Judge 題號: 845: Gas Station Numbers. 解題者:張維珊 解題日期: 2006 年 2 月 題意: 將輸入的數字,經過重新排列組合或旋轉數字,得到比原先的數字大,
1 政治大學國務院國安碩專班選修課 -- 社會科學研究方法(量化分析) -- 黃智聰 政治大學國務院國安碩專班選修課 課程名稱:社會科學研究方法(量化分析) 授課老師:黃智聰 授課內容: 簡單線性迴歸模型:報告結果 與選擇函數型式 參考書目: Hill, C. R., W. E. Griffiths,
Structural Equation Modeling Chapter 6 CFA 根據每個因素有多重指標,以減少 測量誤差並可建立問卷的構念效度 驗證性因素分析.
演算法課程 (Algorithms) 國立聯合大學 資訊管理學系 陳士杰老師 Course 7 貪婪法則 Greedy Approach.
描述統計 描述統計(Descriptive Statistics)-將蒐集到的資料加以整理和記錄,並以數字和統計圖表的方式來分析及解釋資料所具有的特性. 基本統計值(平均數,中位數,標準差,變異量….) 相關性測量(卡方,相關係數,迴歸…)
1 Part IB. Descriptive Statistics Multivariate Statistics ( 多變量統計 ) Focus: Multiple regression Spring 2007.
Unit 3 : 變異數分析 --ANOVA 3.1 範例說明 行銷研究方面, One-Way ANOVA 可 用以研擬市場區隔及目標選擇策略。 教育研究方面,此一模式可用以評估 教師之教學績效。 農業研究方面,此一模式則可用以挑 選使玉米收穫量極大化的肥料。
1 開南大學公管所與國企所合開選修課 -- 量化分析與應用 -- 黃智聰 開南大學公管所與國企所合開選修課 課程名稱:量化分析與應用 授課老師:黃智聰 授課內容: 簡單線性迴歸模型:報告結果 與選擇函數型式 參考書目: Hill, C. R., W. E. Griffiths, and G. G. Judge,
Chapter 7 Sampling Distribution
Cluster Analysis 目的 – 將資料分成幾個相異性最大的群組 基本問題 – 如何衡量事務之間的相似性 – 如何將相似的資料歸入同一群組 – 如何解釋群組的特性.
Structural Equation Modeling Chapter 8 潛伏變數路徑分析=完全 SEM 潛伏變數路徑分析.
連續隨機變數 連續變數:時間、分數、重量、……
Inference for Simple Regression Social Research Methods 2109 & 6507 Spring 2006 March 15, 16, 2006.
Regression 相關 –Cross table –Bivariate –Contingency Cofficient –Rank Correlation 簡單迴歸 多元迴歸.
: Finding Paths in Grid ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11486: Finding Paths in Grid 解題者:李重儀 解題日期: 2008 年 10 月 14 日 題意:給一個 7 個 column.
財務管理概論 劉亞秋‧薛立言 合著 (東華書局, 2007)
Ch 11 建立研究工具的效度與信度.
幼兒行為觀察與記錄 第八章 事件取樣法.
1 Chemical and Engineering Thermodynamics Chapter 1 Introduction Sandler.
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 肆 資料分析與表達.
1 1 Slide The Simple Linear Regression Model n Simple Linear Regression Model y =  0 +  1 x +  n Simple Linear Regression Equation E( y ) =  0 + 
Copyright © 2014, 2011 Pearson Education, Inc. 1 Chapter 19 Linear Patterns.
Presentation transcript:

Copyright © 2011 Pearson Education, Inc. Linear Patterns Chapter 19

19.1 Fitting a Line to Data What is the relationship between the price and weight of diamonds?  Use regression analysis to find an equation that summarizes the linear association between price and weight  The intercept and slope of the line estimate the fixed and variable costs in pricing diamonds Copyright © 2011 Pearson Education, Inc. 3 of 37

19.1 Fitting a Line to Data Consider Two Questions about Diamonds:  What’s the average price of diamonds that weigh 0.4 carat?  How much more do diamonds that weigh 0.5 carat cost? Copyright © 2011 Pearson Education, Inc. 4 of 37

19.1 Fitting a Line to Data Equation of a Line  Using a sample of diamonds of various weights, regression analysis produces an equation that relates weight to price.  Let y denote the response variable (price) and let x denote the explanatory variable (weight). Copyright © 2011 Pearson Education, Inc. 5 of 37

19.1 Fitting a Line to Data Scatterplot of Price vs. Weight Linear association is evident (r = 0.66). Copyright © 2011 Pearson Education, Inc. 6 of 37

19.1 Fitting a Line to Data Equation of a Line  Identify the line fit to the data by an intercept and a slope.  The equation of the line is Estimated Price = Weight. Copyright © 2011 Pearson Education, Inc. 7 of 37

19.1 Fitting a Line to Data Least Squares  Residual: vertical deviations from the data points to the line ( ).  The best fitting line collectively makes the squares of residuals as small as possible (the choice of b 0 and b 1 minimizes the sum of the squared residuals). Copyright © 2011 Pearson Education, Inc. 8 of 37

19.1 Fitting a Line to Data Residuals Copyright © 2011 Pearson Education, Inc. 9 of 37

19.2 Interpreting the Fitted Line Diamond Example  The least squares regression equation for relating diamond prices to weight is Estimated Price = Weight Copyright © 2011 Pearson Education, Inc. 11 of 37

19.2 Interpreting the Fitted Line Diamond Example  The average price of a diamond that weighs 0.4 carat is Estimated Price = ,670(0.4) = $1,111  A diamond that weighs 0.5 carat costs $267 more, on average. Copyright © 2011 Pearson Education, Inc. 12 of 37

19.2 Interpreting the Fitted Line Diamond Example Copyright © 2011 Pearson Education, Inc. 13 of 37

19.2 Interpreting the Fitted Line Interpreting the Intercept  The intercept is the portion of y that is present for all values of x (i.e., fixed cost, $43, per diamond).  The intercept estimates the average response when x = 0 (where the line crosses the y axis). Copyright © 2011 Pearson Education, Inc. 14 of 37

19.2 Interpreting the Fitted Line Interpreting the Intercept Unless the range of x values includes zero, b 0 will be an extrapolation. Copyright © 2011 Pearson Education, Inc. 15 of 37

19.2 Interpreting the Fitted Line Interpreting the Slope  The slope estimates the marginal cost used to find the variable cost (i.e., marginal cost is $2,670 per carat).  While tempting, it is not correct to describe the slope as the change in y caused by changing x. Copyright © 2011 Pearson Education, Inc. 16 of 37

Another empirical problem Empirical problem: Class size and educational output.  Policy question: What is the effect of reducing class size by one student per class? by 8 students/class?  What is the right output (performance) measure? parent satisfaction. student personal development. future adult welfare. future adult earnings. performance on standardized tests.

What do data say about class sizes and test scores? The California Test Score Data Set All K-6 and K-8 California school districts (n = 420) Variables:  5 th grade test scores (Stanford-9 achievement test, combined math and reading), district average.  Student-teacher ratio (STR) = number of students in the district divided by number of full-time equivalent teachers.

An initial look at the California test score data:

Question: Do districts with smaller classes (lower STR) have higher test scores? And by how much?

The class size/test score policy question:  What is the effect of reducing STR by one student/teacher on test scores ?  Object of policy interest:.  This is the slope of the line relating test score and STR.

This suggests that we want to draw a line through the Test Score v.s. STR scatterplot, but how?

Linear Regression: Some Notation and Terminology The population regression line is

 β 0 and β 1 are “population” parameters?  We would like to know the population value of β 1  We don’t know β 1, so we must estimate it using data.

The Population Linear Regression Model— general notation  X is the independent variable or regressor.  Y is the dependent variable.  β 0 = intercept.  β 1 = slope.

 u i = the regression error.  The regression error consists of omitted factors, or possibly measurement error in the measurement of Y. In general, these omitted factors are other factors that influence Y, other than the variable X.

Application to the California Test Score-Class Size data  Estimated slope = =  Estimated intercept = =  Estimated regression line: = ST R

4M Example 19.1: ESTIMATING CONSUMPTION Motivation A utility company that sells natural gas in the Philadelphia area needs to estimate how much is used in homes in which their meters cannot be read. Copyright © 2011 Pearson Education, Inc. 17 of 37

4M Example 19.1: ESTIMATING CONSUMPTION Method Use regression analysis to find the equation that relates y (amount of gas consumed measured in CCF) to x (the average number of degrees below 65º during the billing period). The utility company has 4 years of data (n = 48 months) for one home. Copyright © 2011 Pearson Education, Inc. 18 of 37

4M Example 19.1: ESTIMATING CONSUMPTION Mechanics Linear association is evident. Copyright © 2011 Pearson Education, Inc. 19 of 37

4M Example 19.1: ESTIMATING CONSUMPTION Mechanics The fitted least squares regression line is Estimated Gas = (Degrees Below 65) Copyright © 2011 Pearson Education, Inc. 20 of 37

4M Example 19.1: ESTIMATING CONSUMPTION Message During the summer, the home uses about 26.7 CCF of gas during the billing period. As the weather gets colder, the estimated average amount of gas consumed rises by 5.7 CCF for each additional degree below 65º. Copyright © 2011 Pearson Education, Inc. 21 of 37

Scattergram 1. Plot of all (x i, y i ) pairs 2. Suggests how well model will fit x y

x y Thinking Challenge How would you draw a line through the points? How do you determine which line ‘fits best’?

迴歸分析的基本概念 迴歸分析 (regression analysis) 以成對的資料點 (pair data) 研究兩個或兩個以上變數之間的關係 以兩個變數為例, 所謂成對的資料點 (pair data) 係 指觀察到的資料為 :, 如果經濟理論告訴我 們 x 與 y 之間具有一定的關係, 我們可用 y = f (x) 來 刻畫此關係 舉例來說, 「個人所得」為「教育程度」所影響 ; 或者是「物價膨脹率」為「貨幣供給」所影響

y x Population Linear Regression Model Observed value  i = Random error

Ex : The population regression line and the error term

母體迴歸線 簡單地說, 如果我們擁有母體資料, 母體迴歸線與 相關係數一樣, 都可視為描繪這組母體資料的敘述 統計量

Population & Sample Regression Models Population $ $ $ $ $ Unknown Relationship Random Sample $ $

y x Sample Linear Regression Model Unsampled observation  i = Random error Observed value ^

Least Squares ‘Best fit’ means difference between actual y values and predicted y values are a minimum But positive differences off-set negative Least Squares minimizes the Sum of the Squared Differences (SSE)

最佳預測式 最佳的預測式 f (x) 極小化以下的方差和 利用極小化方差和的概念來解出 (solve) 最佳的預 測式 f (x) 的方法, 我們稱之為最小平方法 (method of least-squares)

最佳常數預測式 如果我們沒有任何 x 的資訊, 對於 y 的最佳預測為 何 ? 亦即, f (x i ) = c 我們稱此預測最佳常數預測式

其一階條件為 因此,

Derivation of the OLS Estimators and are the values of b 0 and b 1 the above two normal equations.

From equations (1) and (2), and divide each term by n, we have

From (3),, substitute in (4) and collect terms, we have

定義 : 誤差 ( 殘差 )

Two Normal Equations From equation (1), we have From equation (2), we have Copyright © 2011 Pearson Education, Inc. 51 of

Least Squares Example You’re a marketing analyst for Hasbro Toys. You gather the following data: Ad $Sales (Units) Find the least squares line relating sales and advertising.

Scattergram Sales vs. Advertising Sales Advertising

Parameter Estimation Solution Table xixi yiyi xixi yiyi xiyixiyi

Parameter Estimation Solution

Regression Line Fitted to the Data Sales Advertising

Least Squares Thinking Challenge You’re an economist for the county cooperative. You gather the following data: Fertilizer (lb.)Yield (lb.) Find the least squares line relating crop yield and fertilizer. © T/Maker Co.

Scattergram Crop Yield vs. Fertilizer* Yield (lb.) Fertilizer (lb.)

Parameter Estimation Solution Table* xixi 2 yiyi xixi yiyi xiyixiyi 2

Parameter Estimation Solution*

Regression Line Fitted to the Data* Yield (lb.) Fertilizer (lb.)

Goodness of fit 如果我們設定 β 0 = μ y, β 1 = 0, 則迴歸線 y = μ y, 也就是說, 最佳常數預測式乃是最佳線性預測式的 一個特例 因此, 我們可以據此衡量, 在加入了 x 的資訊後, 對 於預測 y 的預測力提升多少 ? 這就是迴歸線的配適 度衡量 (goodness of fit) 簡單地說, 迴歸線的配適度衡量就是在比較 : 相對 於最佳常數預測式, 最佳線性預測式增加了多少對 y 的解釋力

Goodness of fit y i − μ y 代表以最佳常數預測式預測 y 的預測誤差 最佳線性預測式的預測誤差為 我們可以將 y 變動的總變異拆解成迴歸線所不能解 釋的變異以及可解釋變異 : 總變異 : 可解釋變異 : 不能解釋變異 :

Goodness of fit 總變異為可解釋變異與不能解釋變異的加總 : TV = EV + UV 因此, 我們可以用「可解釋變異」佔「總變異」的 比例來衡量迴歸線的配適度 : 當 越大, 代表總變異中有越多比例可以被迴歸 線所解釋, 亦即迴歸線的配適度越佳

Goodness of fit 然而, 我們可以用另外一個角度來詮釋迴歸線的配 適度衡量 亦即 可以用來衡量「在加入了 x 的資訊後, 對 於預測 y 的預測力提升多少 ? 」 迴歸線的配適度衡量同時也在比較 : 相對於最佳常 數預測式, 最佳線性預測式增加了多少對 y 的解釋 力

Goodness of fit 令 = 最佳常數預測式的預測誤差, 而 = 最佳線性預測式的預測誤差 由於 TV = EV + UV, 則 因此, 如果 越大, 代表 越小, 也就是說最 佳線性預測式的預測誤差相對於最佳常數預測式 的預測誤差越小, 亦即相對於最佳常數預測式, 最 佳線性預測式所增加的解釋力越多