看板 Statistics 關於我們 聯絡資訊
[軟體程式類別]: 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
BugEater:A資料新創變量year為yearmonth裏面的year+1 04/02 04:45
BugEater:B資料新創變量year為yearmonth裏面的year 04/02 04:46
BugEater:各自分別都用firm和year排序,然後合併,去掉year。 04/02 04:47
green72:感謝BugEater 04/02 21:52