Read dataset with mixed string and number
Posted: Sun May 07, 2017 4:36 am
Dear Tom,
I've got trouble with RATS read data process. My panel data has all numeric columns from 2nd to the end but the first one is a string as it is "country name". Of course I can omit the first one but I want to retain it because I import directly from STATA dataset.
RATS cannot read the first column correctly as it always reports error for the first, but nothing for the remains.
Could you explain me why it is so! And how to solve this problem?
Thanks in advance,
I've got trouble with RATS read data process. My panel data has all numeric columns from 2nd to the end but the first one is a string as it is "country name". Of course I can omit the first one but I want to retain it because I import directly from STATA dataset.
RATS cannot read the first column correctly as it always reports error for the first, but nothing for the remains.
Code: Select all
OPEN DATA "H:\RATS_codes\Asean6.dta"
CALENDAR(PANELOBS=46,A) 1970:1
DATA(FORMAT=DTA) 1//1970:01 8//2015:01 country year f_cons h_cons g_cons gr_cap $
gf_cap chg_inv exports imports rgdp rgdp_agri rgdp_mining rgdp_manu rgdp_const $
rgdp_trade rgdp_trans rgdp_others tv_added pop cnt_id tb xmy
Thanks in advance,