[問題] SAS fixed year effect的操作

看板Statistics作者 (aa4997)時間3年前 (2021/03/13 11:15), 編輯推噓0(0011)
留言11則, 3人參與, 3年前最新討論串1/1
[軟體程式類別]: sas [程式問題]: SAS fixed year effect的操作 [軟體熟悉度]: 新手 [問題敘述]: 一開始先手動在資料中加入年份虛擬變數,為避免dummy variable trap因此有先減少一 個虛擬變數的類別, 但使用proc reg後,程式自動判定有超過兩個虛擬變數出現共線性問題,而出現共線性的 數目亦會隨我替換其他非年份control varibles而不同 因此後來改使用proc glm,由程式幫我產生虛擬變數,但卻會出現以下文字: The X'X matrix has been found to be singular, and a generalized inverse was us ed to solve the normal equations. Terms whose estimates are followed by the le tter 'B' are not uniquely estimable. 另外,使用proc glm的話,似乎無法得到迴歸的adj r square, 爬文與google後仍然不知道如何解決,所以來請大家指點,該如何操作fixed effect同時 又能得到adj r square 感激不盡 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.140.188.10 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Statistics/M.1615605324.A.C2B.html

03/13 11:20, 3年前 , 1F
檢查VIF或所有自變數間的相關係數。
03/13 11:20, 1F

03/13 11:20, 3年前 , 2F
通常可以找到答案
03/13 11:20, 2F

03/13 11:31, 3年前 , 3F
想請問大大,我的資料期間是2000~2020,使用的虛擬變數
03/13 11:31, 3F

03/13 11:31, 3年前 , 4F
分別是y2001,y2002....y2020,如果是該年度則設為1,但可
03/13 11:31, 4F

03/13 11:31, 3年前 , 5F
能出現y2005跟y2006會與其他年份有共線性因此被拿掉,請
03/13 11:31, 5F

03/13 11:31, 3年前 , 6F
問這樣該如何跑fixed year effect呢?感謝!
03/13 11:31, 6F

03/13 18:04, 3年前 , 7F
貼code和資料看看吧
03/13 18:04, 7F

03/18 03:27, 3年前 , 8F
先不論共線性的問題,基本上拿迴歸和GLM來分析時間序列
03/18 03:27, 8F

03/18 03:28, 3年前 , 9F
資料,最後的殘差檢定幾乎都不會過,因為資料極大可能早
03/18 03:28, 9F

03/18 03:28, 3年前 , 10F
已經違反了獨立性假設。你應該要改用mixed model或者是
03/18 03:28, 10F

03/18 03:29, 3年前 , 11F
nonlinear model
03/18 03:29, 11F
文章代碼(AID): #1WJ2vCmh (Statistics)