Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72762

Factor variables and time-series operators not allowed

$
0
0
I'm working with the database of the National Sample Survey (PNAD) of the Brazilian Institute of Geography and Statistics (IBGE) and this present a sampling plan complex'm making use of svyset command and following the following programming code found in some papers:

svyset psu [pweight = crianpesopes] singleunit (centered) strata (strat)

svydes, single

save DADOSCRIANCA2006-2014, replace

novostrat gen =.
novopsu gen =.
save ytd, replace

capture program drop prog1
program defines prog1
use "D: \ Master \ Classes \ PNADs \ Dados_Dissertacao \ DADOSCRIANCA2006-2014.dta" clear
keep if uf == state
gen novostrat = strat
gen novopsu = psu
quietly {
save transferrin, replace
use accum, clear
append using transferrin
save ytd, replace
}
end

capture program drop PROG2
program defines PROG2
use "D: \ Master \ Classes \ PNADs \ Dados_Dissertacao \ DADOSCRIANCA2006-2014.dta" clear
keep if uf == state
idonepsu strata (strat) psu (psu) generate (new) quietly {save transferrin, replace use accum, clear append using transferrin save ytd, replace}
end

= scalar state.

foreach i in 53 {
scalar state = `i '
prog1
}

foreach i in 11 12 13 14 15 16 17 21 22 23 24 25 26 27 28 29 31 32 33 35 41 42 43 50 51 52 {
scalar state = `i '
PROG2
}

At the end of this code appears the following error message:

variables and time-series factor operators not allowed
R (101);

As I am still learning how to use Stata like to know how I can work around this problem, because I have seen that a person also reported this issue in this forum, but she was already making use of regressions and I'm still preparing my data, and I think the solution that was given to it does not apply to my case.

Viewing all articles
Browse latest Browse all 72762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>