是你那样写的吗?
看看帮助的例子啊。
----------------------------------------------------------------------------------------------------------------
Setup
. webuse egenxmpl4, clear
Create hsum containing the row sum of a, b, and c for each row
. egen hsum = rowtotal(a b c)
Create havg containing the row mean of a, b, and c for each row
. egen havg = rowmean(a b c)
Create hstd containing the row standard deviation of a, b, and c for each row
. egen hsd = rowsd(a b c)
Create hnonmiss containing the number of nonmissing observations of a, b, and c for each row
. egen hnonmiss = rownonmiss(a b c)
Create hmiss containing the number of missing observations of a, b, and c for each row
. egen hmiss = rowmiss(a b c)
List the results
. list