0

我在 Stata 中有 2 个表格:一个显示每个州在特定离婚年份队列中离婚的父母总数,另一个显示csphycus == 2每个州和离婚年份队列中离婚父母的数量。

csphycus ==2我想要一个表格,显示每个州和每个离婚年份队列的父母百分比。所以我想划分这两个表中的计数。我该怎么做?

4

1 回答 1

0

你的意思是

egen double numer = total(rdasecwt * (csphycus == 2)), by(statefip yrdivbin) 
egen double denom = total(rdasecwt), by(statefip yrdivbin) 
gen wanted = 100 * numer/denom 

你可以通过一些变化来展示它

tabdisp statefip yrdivbin, c(wanted) format(%2.1f) 
于 2020-06-02T07:07:03.430 回答