Remove design variables (cluster IDs, strata, FPC, probabilities, weights) from a survey design object and attaches the sampling weights as a single column, returning a plain data frame ready for modeling.
extract_analysis_data(des, weight_name = "sp_wts")A data frame containing the analysis variables from `des$variables` (design variables removed) plus one column named `weight_name` storing the sampling weights.
A survey design object of class `survey.design2` or `svyrep.design`.
A single string giving the name of the weight column added to the output. Defaults to `"sp_wts"`. Must not already exist among the analysis variables after design variables are removed.
Cluster and strata variables are identified from the design object's own fields (`des$cluster`, `des$strata`) rather than the original call, so the result is correct even when `des` has been subset after construction. Weights, FPC, and probability variables are still read from `des$call`. For replicate designs (`svyrep.design`), replicate weight columns are also dropped.