Hello,
I am trying to rescale weights within a single NSFG survey wave to have a mean of 1, however Stata is not returning anything when I use the 'display' command. Stata also says invalid syntax when I attempt to multiply the weight by the new scaling factor, but I can't find anything wrong with it. Is there something small here that is wrong, or am I misunderstanding something about how local macros and scalars work?
summarize finalwgt
return list
local rescalefactor = `r(N)'/`r(sum)'
display `rescalefactor' /// This is the line that returns nothing to me
gen weight2 = .
replace weight2 = finalwgt*`rescalefactor' // Stata error says invalid syntax
summarize weight2
Thank you in advance!
Related Posts with Stata local macros not displaying
How to fix a missing wald chi square valueDear all, I have a question how to fix a missing wald chi square value. I have calculated xtlogit, …
vmatch functionDear community members, I need to match my cases with exact controls on several variables. I heard …
Estimation of GMM model with time dummiesDear Scholars/Researchers, I am still confused and would like to ask that, Is it necessary to estima…
JDBC connection to Google BigQuery DatabaseDoes anyone here connect to BQ using JDBC successfully? I've been trying to make this work, as I did…
Esttab in a loop and getting table for summary statisticsHello everyone, I have a question about esttab command in a loop and getting the entire output in an…
Subscribe to:
Post Comments (Atom)
0 Response to Stata local macros not displaying
Post a Comment