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!