[程式] sas資料處理

看板Statistics作者 (圈叉)時間11年前 (2014/04/02 00:59), 編輯推噓0(004)
留言4則, 2人參與, 最新討論串4/4 (看更多)
[軟體程式類別]: SAS [程式問題]: 資料處理 [軟體熟悉度]: 新手(不到1個月) [問題敘述]: 我有兩份資料需要合併,A資料是年資料,B資料是月資料,例如: A資料 B資料 firm yearmonth a firm yearmonth ret 1101 199012 1 1101 199101 1102 199012 2 1102 199101 1101 199112 3 1101 199102 1102 199112 4 1102 199102 .... 1101 199201 1102 199201 我的問題在於我要將A資料中每年度的a貼到B資料"下一年度"的每個月份中 合併後的資料如下 firm yearmonth ret a 1101 199101 1 1102 199101 2 1101 199102 1 1102 199102 2 .... 1101 199201 3 1102 199201 4 請版上高手解救,感謝。 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 42.79.248.152 ※ 文章網址: http://www.ptt.cc/bbs/Statistics/M.1396371575.A.9B5.html

04/02 04:45, , 1F
A資料新創變量year為yearmonth裏面的year+1
04/02 04:45, 1F

04/02 04:46, , 2F
B資料新創變量year為yearmonth裏面的year
04/02 04:46, 2F

04/02 04:47, , 3F
各自分別都用firm和year排序,然後合併,去掉year。
04/02 04:47, 3F

04/02 21:52, , 4F
感謝BugEater
04/02 21:52, 4F
文章代碼(AID): #1JEl1tcr (Statistics)
文章代碼(AID): #1JEl1tcr (Statistics)