Solutions to problem 7:
Part a:
foreach x of varlist x10-x30 {
count if `x' < 0
}
Part b:
foreach x of varlist x10-x30 {
sum `x', meanonly
local m=r(mean)
count if `x' < `m'
}
Solutions to problem 7:
Part a:
foreach x of varlist x10-x30 {
count if `x' < 0
}
Part b:
foreach x of varlist x10-x30 {
sum `x', meanonly
local m=r(mean)
count if `x' < `m'
}