Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using lambda

    Hi!!!, I am trying to use "lambda" following stata code from CEQ paper. They use lambda to generate a variable ( apparently), but when I run code, stata generate error saying that 1_m is invalid name, the code is below;
    foreach y in m d {
    sum y`y'_BC if i==1 [w=factor]
    scalar total`y'_BC= r(sum)

    forval i=1/10 { //loop for deciles
    sum y`y'_BC if ym_BC_decile==`i' & i==1 [w=factor]
    scalar total`y'_BC_`i'= r(sum)
    lambda `i'_`y' = total`y'_BC_`i'/total`y'_BC
    }
    }
    Maybe you can help to understand this, because the syntax from command is just for tabulate. Thanks, regards



Working...
X