Displaying 20 results from an estimated 100 matches similar to: "svyplot and svysmooth with hexbin"
2016 Apr 30
0
Unexpected scores from weighted PCA with svyprcomp()
Hello!
I'd like to create an assets-based economic indicator using data from a
national household survey. The economic indicator is to be the first
principal component from a principal components analysis, which (given
the source of the data) I believe should take in consideration the
sampling weights of the observations. After running the PCA with
svyprcomp(), from the survey package, I
2010 Mar 10
1
Strange result in survey package: svyvar
Hi R users,
I'm using the survey package to calculate summary statistics for a large
health survey (the Demographic and Health Survey for Honduras, 2006), and
when I try to calculate the variances for several variables, I get negative
numbers. I thought it may be my data, so I ran the example on the help
page:
data(api)
## one-stage cluster sample
dclus1<-svydesign(id=~dnum, weights=~pw,
2012 Oct 16
1
Package survey: Compute standard deviations from complex survey designs
Hello,
svyvar from the survey package computes variances (with standard errors)
from survey design objects. Is there any way to compute standard
deviations and their standard errors in a similar manner?
Thanks a lot,
Sebastian
2011 Oct 24
4
Problem with svyvar in survey package
I am facing a problem with a function in survey package. The function svyvar
gives the estimated population variance from a given sampling scheme. I am
working with a data having more than four continuous variables. In order to
have have population total for all those cont. variables I have written in
the following format
svyvar(~var1+var2+var3+var4+var5+var6,data) ; var1,var2,...,var6 are 6
2012 Oct 10
2
svyplot
Hello,
Using the svyplot () function, I have plotted four graphs that are saved in four different .png files.
I am looking for examples how to redraw the same four graphs within grid viewports so that they stay together on a page. The goal is to create one .png file that will include all four graphs (2 rows, 2 columns).
Any help would be appreciated.
Thanks,
Pradip
Pradip K. Muhuri,
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
2005 Jun 16
1
Survey - Cluster Sampling
Dear WizaRds,
I am struggling to compute correctly a cluster sampling design. I want
to do one stage clustering with different parametric changes:
Let M be the total number of clusters in the population, and m the
number sampled. Let N be the total of elements in the population and n
the number sampled. y are the values sampled. This is my example data:
clus1 <-
2009 Oct 14
0
Error from termplot() with make.panel.svysmooth() for complex survey data
Greetings,
I am using library(survey) to analyze some complex sample data. After
fitting a model I tried to use termplot() with make.panel.svysmooth(), but
I received an error (see below).
Could someone help me interpret the error message so I can make the
necessary corrections? The make.panel.svysmooth() function seems to work
fine, and termplot() worked fine after I dropped the smoother.
2009 Mar 11
1
CI from svyquantile in survey package
I am having trouble understanding (i.e. getting) confidence intervals from
the survey package. I am using R version 2.8.1 (2008-12-22) and survey
package (3.11-2) on FC7 linux. To simplify my question I use an example from
that package:
R> data(api)
R> dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
R> (tst <- svyby(~api99, ~stype,
2009 Nov 02
2
"object not found" within function
Hi,
I am trying to write a function to compute many cross-tabulations with the -svytable- command. Here is a simplified example of the structure of my code (adapted from the -svytable- help file):
data(api)
func.example<-function(variable){
dclus1<-svydesign(id=~1, weights=~pw,data=apiclus1, fpc=~fpc)
svytable(~ variable, dclus1)
}
When I call this function with:
2011 Jul 22
1
Recoding Multiple Variables in a Data Frame in One Step
Hi, I can't for the life of me find how to do this in base R, but I'd be
surprised if it's not possible.
I'm just trying to replace multiple columns at once in a data frame.
#load example data
data(api)
#this displays the three columns and eight rows i'd like to replace
apiclus1[ apiclus1$meals > 98 , c( "pcttest" , "api00" , "sch.wide" ) ]
2015 Apr 16
4
Weighted Likelihood
¡Muchas gracias Olivier!
Un saludo.
El 16 de abril de 2015, 10:44, Olivier Nuñez <onunez en unex.es> escribió:
> Mira el paquete survey.
> Un saludo. Olivier
>
> ----- Mensaje original -----
> De: "Víctor Nalda Castellet" <victor.nalda.castellet en gmail.com>
> Para: "r-help-es" <r-help-es en r-project.org>
> Enviados: Miércoles, 15 de
2010 Feb 18
1
survey package question
Should the svyby function be able to work with svyquantile? I get the
error below ...
data(api)
dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
svyby(~api00,
design=dclus1,
by = ~stype,
quantiles=c(.25,.5,.75),
FUN=svyquantile,
na.rm=T
)
> Error in object$coefficients : $ operator is invalid for atomic
vectors
A
2012 Oct 14
2
svyhist and svyboxplot
Hello,
The following code is expected to produce 4 charts. But, I only get charts 1,2 ,& 4, NOT CHART # 3.
For Chart# 3, I am getting the following error message: Error in tapply(1:NROW(x), list(factor(strata)), function(index) { : arguments must have same length
I would appreciate if someone could help me resolve the issue.
Thanks,
Pradip
# BELOW IS THE REPRODUCIBLE EXAMPLE
setwd
2010 Mar 26
1
return.replicates in survey pkg
How do I retrieve the replicates estimates from a crosstab done using
svyby?
Here is an example from the help page for svyby in the package:
> data(api)
> dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
> rclus1<-as.svrepdesign(dclus1)
>
> a <- svyby(~api99, ~stype, rclus1, svymean, return.replicates=TRUE)
> a$replicates
NULL
But, compare to
> b
2010 Aug 18
1
svyquantile w/ svyby is returning an error
svymean w/ svyby is working for me...
> svyby(~visitcnt, ~agegrp3.f, svymean, design=svydes)
agegrp3.f visitcnt se.visitcnt
18-44 18-44 8.755552 0.4953235
45-64 45-64 10.131555 0.5347806
65+ 65+ 9.588802 0.4323629
svyquantile is working for me...
> svyquantile(~visitcnt, quantiles=c(.25, .5, .75), ties="rounded", design=svydes)
0.25
2012 Jun 28
1
SVY: variance inflation factor VIF with complex survey
Hello,
Seeking a way to get the variance inflation factor VIF for a model of regression in complex survey, I have understood that without this package (SURVEY) RGui VIF obtained as follows:
fit <- lm(mpg~disp+hp+wt+drat, data=mtcars)
vif(fit)
But I want to know if survey, Vif is obtained so
vif( svyglm(api00~ell+meals+mobility, design=dstrat))
Thank you, happy day
2012 Mar 25
1
Nonparmetric statistics with weighted data set?
I'm doing some work with a weighted data set (the CPS) and I'd like to
use nonparametric techniques. Is there an R package that supports this?
The np package doesn't appear to have provisions for weighted data. (Or
have I missed something?) I need to perform both density estimation and
regressions.
thanks,
bw
2012 Oct 05
1
svyhist
Hello,
I was trying to draw histograms of age at death and got the following 2 error messages:
1) Error in tapply(1:NROW(x), list(factor(strata)), function(index) { :
arguments must have same length
2) Error in findInterval(mm[, i], gx) : 'vec' contains NAs
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) :
2006 Apr 11
4
Bootstrap and Jackknife Bias using Survey Package
Dear R users,
I?m student of Master in Statistic and Data analysis, in New University of Lisbon. And now i?m writting my dissertation in variance estimation.So i?m using Survey Package to compute the principal estimators and theirs variances.
My data is from Incoming and Expendire Survey. This is stratified Multi-stage Survey care out by National Statistic Institute of Mozambique. My domain of