= Stata svy = The '''`-svy-`''' prefix command adjusts estimation commands to take a survey design into account. <> ---- == Usage == The [[Stata/SvySet|-svyset-]] command must be used first, to declare the survey design. As [[https://stats.oarc.ucla.edu/stata/faq/how-do-i-use-the-stata-survey-svy-commands/|an example]]: {{{ use https://stats.idre.ucla.edu/stat/stata/faq/svysmall, clear svyset house [pweight = wt], strata(eth) svy: regress y x1 x2 x3 }}} `svy` commands use [[Analysis/StudentsTDistribution|t statistics]] with ''n - L'' [[Statistics/DegreesOfFreedom|df]], where ''n'' is the number of PSUs and ''L'' is the number of first stage strata, rather than [[Analysis/NormalDistribution#Standard_Normal_Distribution|Z statistics]]. Following from this, the [[Stata/Test|test]] command technically runs an adjusted [[Statistics/WaldTest|Wald test]]. `svy` estimation commands like [[Stata/Regress|regress]] use [[Statistics/MaximumPseudoLikelihood|maximum pseudo-likelihood]] rather than [[Statistics/MaximumLikelihood|ML]]. ---- == See also == [[https://www.stata.com/manuals/svysvy.pdf|Stata manual for -svy-]] ---- CategoryRicottone