*! version 1.0.2  08may2003
program est_hold, eclass
	version 8
	args name esample holdopt

	if "`e(cmd)'" != "" {
		capt confirm variable `esample'
		local reset = _rc==0

		if `reset' {
			tempvar touse
			qui gen byte `touse' = `esample'
			qui replace `touse' = 0 if missing(`touse')  
			ereturn repost , esample(`touse')
		}
		_est hold `name', nullok estimates varname(_est_`name') `holdopt'
		if `reset' {
			capt replace _est_`name' = `esample'
		}
	}
	else {
		_est hold `name', nullok estimates varname(_est_`name')
	}
end
