search for: fpc2

Displaying 5 results from an estimated 5 matches for "fpc2".

Did you mean: fc2
2012 Oct 18
3
svyplot and svysmooth with hexbin
...thing to do with Lattice graphics, but for the life of me I can not figure out how. Dr. Lumley in his excellent book on page 118 mentions that there is code on his website to do this, but I can not find it. So for example: library(survey) data(api) dclus2<-svydesign(id=~dnum+snum, fpc=~fpc1+fpc2, data=apiclus2) svyplot(api00~api99, dclus2) s1 <-svysmooth(api00~api99, dclus2) lines(s1) #works svyplot(api00~api99, dclus2, style="grayhex") lines(s1) #does not work (line either appears in the wrong position in RGui or crashes RStudio). VR James James T. Durant, MSPH CIH E...
2005 Oct 09
1
enter a survey design in survey2.9
...ivised in two regions / Urbain and rural. this are strata in Rural : PSU are subdivision , SSU are EA and TSU are households in Urban : PSU are EA , SSU are households. I use svydesign function as follow : esi<-svydesign(id=~subdiv+EA+HHID,strata=~REGION+AREATYP,fpc=~FPC1+FPC2FPC3,weig=~pw,nest=T) FPC1: number of subdivision in each strata FPC2: number of EA in each subdivision FPC3: number of HH in each EA. pw : sampling weights but I have this error message : erron in data.frame(strata, 1:i,...) I dont understand why ! Can someone help me ? Sincerly....
2008 Sep 12
2
Fw: Complex sampling survey _ Use of survey package
-------------------------------------------------- From: "Ahoussou Sylvie" <sylvie.ahoussou at antilles.inra.fr> Sent: Friday, September 12, 2008 9:48 AM To: "Thomas Lumley" <tlumley at u.washington.edu> Subject: Re: [R] Complex sampling survey _ Use of survey package > Thanks for your answer > > I think I made a mistake when I recopied the 5 first rows of
2011 Mar 07
1
Risk differences with survey package
I'm trying to use the survey package to calculate a risk difference with confidence interval for binge drinking between sexes. Variables are X_RFBING2 (Yes, No) and SEX. Both are factors. I can get the group prevalences easily enough with result <- svyby(~X_RFBING2, ~SEX, la04.svy, svymean, na.rm = TRUE) and then extract components from the svyby object with SE() and coef() to do the
2016 Apr 30
0
Unexpected scores from weighted PCA with svyprcomp()
...survey)) covariance.matrix <- svyvar(formula, design) variables <- diag(covariance.matrix) correlation.matrix <- covariance.matrix / sqrt(variables %*% t(variables)) return(correlation.matrix) } library(survey) data(api) dclus2 <- svydesign(ids = ~ dnum + snum, fpc = ~ fpc1 + fpc2, data = apiclus2) pc <- svyprcomp( ~ api99 + api00, design = dclus2, scale = TRUE, scores = TRUE) dclus2$variables$pc1 <- pc$x[, "PC1"] dclus2$variables$pc2 <- predict(pc, apiclus2)[, "PC1"] mycoef <- pc$rotation[, "PC1"] / pc$scale dclus2$variables$pc3 &lt...