similar to: Unexpected scores from weighted PCA with svyprcomp()

Displaying 20 results from an estimated 200 matches similar to: "Unexpected scores from weighted PCA with svyprcomp()"

2012 Oct 18
3
svyplot and svysmooth with hexbin
Hi all- So sorry to bother you all with something pretty basic. I am trying to add the lines method output from svysmooth to a svyplot with style="grayhex". However, the line either appears in the wrong place or if I am running in R Studio it causes the system to crash. I know this is something to do with Lattice graphics, but for the life of me I can not figure out how. Dr. Lumley
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,
2006 May 19
1
UseMethod infelicity
If I do > example(lm) ... > mycoef <- function(object, ...) UseMethod("coef", object) > mycoef(lm.D9) Error in mycoef(lm.D9) : no applicable method for "coef" which is pretty surprising, as coef has a default method. After a bit of digging, this comes from do_usemethod having defenv = environment where the generic was defined */ defenv =
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
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,
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" ) ]
2012 May 05
2
No error message no display output
Hi all, I´m re-starting (as my name indicates) my little knowlegde of CRAN R. I made this function time before but I don´t know where is the error because nothing appears as an error but the histogram plot doesn´t appear. Should I install some special library to run sapply? pru<-function(){ randz<-matrix(rnorm(200000),100,2000) H<-matrix(0,100,2000) for (j in 2:2000){ for (i in
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
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
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:
2012 May 10
1
Error t value matrix
Hi all, I want to make the following: I want to run a linear regression on each column of a matrix "estima" on the correspondent column on the matrix "estima2". You see I want to regress estima[,1] on estima2[,1] this way to all columns.... At the same time I want to make a regression adding each time a new observation. You see, the first regression will regress only one
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 <-
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
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
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
2014 Oct 15
2
Advice on package design for handling of dots in a formula
I am working on a new package, one in which the user needs to specify the role that different variables play in the analysis. Where I'm stumped is the best way to have users specify those roles. Approach #1: Separate formula for each special component First I thought to have users specify each formula separately, like: new.function(formula=y~X1+X2+X3, weights=~w,
2010 Mar 02
1
Output to sequentially numbered files... also, ideas for running R on Xgrid
Hello, I have some code to run on an XGrid cluster. Currently the code is written as a single, large job... this is no good for trying to run in parallel. To break it up I have basically taken out the highest level for-loop and am planning on batch-running many jobs, each one representing an instance of the removed loop. However, when it comes to output I am stuck. Previously the output was
2009 Feb 03
0
survey 3.11
Version 3.11 of the survey package is making its way through CRAN. Since the last announcement on this list, of version 3.9, last September, there have been many minor bug fixes and usability improvements. The main new features are - loglinear models with svyloglin() - database-backed designs now allow new variables to be created, support ODBC in addition to DBI database interfaces, and