Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Programming FGT using weights

From   "Yanina Lewit" <>
To   <>
Subject   st: Programming FGT using weights
Date   Mon, 3 May 2004 19:19:17 -0300 (GMT-3)

I´m using data of Argentina´s household survey. I´m defining a program for
calculate FGT. I have different poverty lines (zetane, zetacu, zetagba,
zetano,zetapam, zetapat )in differents states of the country diffing by
the variable region. This work perfectly coherent with other results I got
using stata.
The point is I want to calculated this program using weights, and It
wasn´t possible to me to modify this program for using them. Does someone
could help me?
best regards

Here is the program I´m using under stata version 6.0

capture program drop fgtreg

program define fgtreg, rclass

syntax varlist(max=1), alfa(real) zetane(real) zetacu(real) zetagba(real)
zetano(real) zetapam(real) zetapat(real)
quietly {

tempvar each suma

gen `each'=.

gen `suma'=.

replace `each'=1*(1-`varlist')/`zetane')^`alfa' if region==41

replace `each'=1*(1-`varlist'/`zetacu')^`alfa' if region==42

replace `each'=1*(1-`varlist'/`zetagba')^`alfa' if region==1

replace `each'=1*(1-`varlist'/`zetano')^`alfa' if region==40

replace `each'=1*(1-`varlist'/`zetapam')^`alfa' if region==43

replace `each'=1*(1-`varlist'/`zetapat')^`alfa' if region==44

replace `suma'=sum(`each')

local fgtreg=`suma'[_N]/_N
return scalar fgtreg = `fgtreg'

display in yellow "FGT `varlist'= `fgtreg'"


*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index