I am trying to use the R package 'survey' to produce some weighted descriptors of a dataset (Fragile Families) for a meta-analysis. According to the documentation, the weights are provided by the variable k4natwt, and the replication weights are provided by a series of variables: 'k4natwt_rep1 - k4natwt_rep26'.
The documentation further specifies the correct svyset command in Stata would be:
svyset [pweight=BASICWEIGHT], jkrw(REPLICATES, multiplier(1)) vce(jack) mse
I'm trying to replicate this survey design in R, but I think I am doing it incorrectly. I have a loose knowledge of the relevant statistics, and I suspect I am incorrectly translating the multiplier(1) argument in Stata in to the rscales argument in survey (for that matter, I may be incorrectly assuming that they are getting at the same statistical construct). Here's what I have in R so far (here I'm just trying to get a weighted mean of the cm4b.age variable).
> y5design<-svrepdesign(repweights="k4natwt.rep[1-9]+",type="JKn",weights=~k4natwt,data=y5weighted,combined.weights=TRUE,rscales=1) > y5design Call: svrepdesign.default(repweights = "k4natwt.rep[1-9]+", type = "JKn", weights = ~k4natwt, data = y5weighted, combined.weights = TRUE, rscales = 1) Stratified cluster jackknife (JKn) with 26 replicates. > svymean(y5weighted$cm4b.age,y5design,na.rm=TRUE) Error in dimnames(x) <- dn : length of 'dimnames'  not equal to array extent
So here are my questions: 1. Is this the most correct svrepdesign statement for the design? 2. What am doing wrong such that I get the dimnames error?