Hi everyone,
I am importing panel data from an Excel file into STATA, but for three dichotomous variables (original value is 1/0) I get missing values (i.e., a '.') for certain years. The data in the Excell file is arranged in multiple sheets which are named according to the year, e.g., 2005, 2006.....2019, and 2020. For 2020 and 2019, I get correct values of 1 or 0 in the STATA. But for all other years, I get a "." I am using the following loop to import my data:
forvalues i= 2005/2020 {
import excel using fin_aid_data_2023.xlsx, firstrow sheet(`i') clear
if `i'==2005 {
save fin_aid_data, replace
}
else {
append using fin_aid_data, force
save fin_aid_data, replace
}
}
I will appreciate your advice.
Ijaz
I am importing panel data from an Excel file into STATA, but for three dichotomous variables (original value is 1/0) I get missing values (i.e., a '.') for certain years. The data in the Excell file is arranged in multiple sheets which are named according to the year, e.g., 2005, 2006.....2019, and 2020. For 2020 and 2019, I get correct values of 1 or 0 in the STATA. But for all other years, I get a "." I am using the following loop to import my data:
forvalues i= 2005/2020 {
import excel using fin_aid_data_2023.xlsx, firstrow sheet(`i') clear
if `i'==2005 {
save fin_aid_data, replace
}
else {
append using fin_aid_data, force
save fin_aid_data, replace
}
}
I will appreciate your advice.
Ijaz
Comment