Hi everyone. Im new to stata and cant figure out where the problem is. The errror says: Cant find variable race. If I put the weights back into the command: weights not found. The variables are in the dataset im using.
use $data/psid_10.dta
keep if region==1
preserve
* Collapse
collapse (p90) wealth_w_equity
*[aweights]
**[aw=weights]
collapse (sum) wealth_total=wealth_w_equity
*[aweights],
*by( race)
* Scale to million USD
replace wealth_total=wealth_w_equity/1000000
* Graph
*graph bar home_equity wealth_w_equity stack, over(region race)
graph bar (sum) wealth_total, over(race)
restore
*log close
use $data/psid_10.dta
keep if region==1
preserve
* Collapse
collapse (p90) wealth_w_equity
*[aweights]
**[aw=weights]
collapse (sum) wealth_total=wealth_w_equity
*[aweights],
*by( race)
* Scale to million USD
replace wealth_total=wealth_w_equity/1000000
* Graph
*graph bar home_equity wealth_w_equity stack, over(region race)
graph bar (sum) wealth_total, over(race)
restore
*log close
Comment