Re: [R] Survey package/svyby source code help

2020-02-11 Thread AndertechLLC--- via R-help
Thank you for responding. I am truly grateful. Apologies for omitting evident and pertinent information. I am using 3.36. I will update to 3.37. I did not notice the newer version. I realize I needed to be more specific. The attr(, "var") that I am interested in is displayed with str(result

Re: [R] Survey package/svyby source code help

2020-02-11 Thread Ivan Krylov
On Tue, 11 Feb 2020 15:23:14 + andertech...@protonmail.com wrote: > The attr(, "var") that I am interested in is displayed with > str(results) after the results object is declared. First line of the > subject code looks like: > > results <- (if (multicore) parallel::mcapply else lapply)(uniq

Re: [R] Survey package/svyby source code help

2020-02-11 Thread Ivan Krylov
On Tue, 11 Feb 2020 02:33:45 + AndertechLLC--- via R-help wrote: > When debugging the code I am not following the generation of values > in the results object attr(*, "var")" after line 57 completes. These > values are fed into line 74 (rval <- t(sapply(results, unwrap))). Which version of t

[R] Survey package/svyby source code help

2020-02-11 Thread AndertechLLC--- via R-help
Good day, I was looking for some help with understanding a particular portion of the svyby source code. When debugging the code I am not following the generation of values in the results object attr(*, "var")" after line 57 completes. These values are fed into line 74 (rval <- t(sapply(results,

[R] survey package rake results in very large weights

2015-01-19 Thread Imran Akbar
Hi, I'm trying to use both the survey package and the anesrake package to perform raking on my sample dataset, to get the proportions to match up with population data from the census. I'm trying the following, but the resulting weights are very large: > svy.unweighted <- svydesign(ids=~1, dat

Re: [R] "survey" package -- doesn't appear to match svy

2014-10-28 Thread Anthony Damico
could you provide a minimal reproducible example? perhaps use ?dput. in general the survey package matches all other languages http://journal.r-project.org/archive/2009-2/RJournal_2009-2_Damico.pdf here's an example of a minimal reproducible example that does match http://www.ats.ucla.edu/stat

[R] "survey" package -- doesn't appear to match svy

2014-10-27 Thread Stephen Amrock
Hi, I'm new to R and have encountered two issues in coding using the "survey" package: (1) Code from *svytable* using "survey" package does not correspond to Stata estimates from *svy: tab*. I call svyd.nation <- svydesign(ids = ~1, probs = ~wt_national, strata = ~stratum, data=nats.sub)

[R] Survey package help with svystandardize

2013-01-03 Thread Chris Webb
I am trying to age standardize using the svystandardize package in R. I have successfully managed to hit my SUDAAN based targets for estimates by sex, but not the total. The total is only a little different, but I'd like some help knowing why it isn't exact. I've included the SUDAAN code that gener

Re: [R] survey package question

2012-10-11 Thread Sebastián Daza
Hello Thomas, I use both svymean (with the expanded sample = people), and svyratio (voting unit level), using the same design: design <-svydesign(id=~station + unit, fpc=~probstation+probunits, data=sample, pps="brewer") I got different results using the same sample: svyratio (voting unit)

Re: [R] survey package question

2012-10-11 Thread Thomas Lumley
On Fri, Oct 12, 2012 at 6:56 AM, Sebastián Daza wrote: > Hello, > > I have got a cluster sample using an election dataset where I already > had the final results of a county-specific election. I am trying to > figure out what would be the best sampling design for my data. > > The structure of the

[R] survey package question

2012-10-11 Thread Sebastián Daza
Hello, I have got a cluster sample using an election dataset where I already had the final results of a county-specific election. I am trying to figure out what would be the best sampling design for my data. The structure of the dataset is: 1) polling station (in general schools where people vo

Re: [R] Survey package: using subset option with svyrepdesign

2012-08-09 Thread BrentMast
I found the problem. My data were not in a data.frame. Thanks, Brent -- View this message in context: http://r.789695.n4.nabble.com/Survey-package-using-subset-option-with-svyrepdesign-tp4639802p4639858.html Sent from the R help mailing list archive at Nabble.com.

[R] Survey package: using subset option with svyrepdesign

2012-08-09 Thread BrentMast
Hi. I'm using American Housing Survey (AHS) data with replicate weights. I want subpopulation estimates. When I try to subset the survey design, I get an error message. I don't get the error message when not using the replicate weights (using the regular svydesign function). Any help would be ap

Re: [R] Survey package GLM vs. Linear Mixed Models?

2012-07-25 Thread RNewby
Hi there, haven't heard from anyone and just wondering if anyone had any insight! Thanks. :) -- View this message in context: http://r.789695.n4.nabble.com/Survey-package-GLM-vs-Linear-Mixed-Models-tp4636207p4637797.html Sent from the R help mailing list archive at Nabble.com. _

[R] Survey package GLM vs. Linear Mixed Models?

2012-07-11 Thread RNewby
Hi there, I'm new to some of these more advanced regression techniques and also new to R. This looks like a great forum. I am trying to examine the association with membership in a group and some different variables, most of which are (approximately) normally distributed. Would just do an ANOVA

Re: [R] survey package svystat objects from predict()

2012-02-13 Thread Thomas Lumley
On Tue, Feb 14, 2012 at 11:45 AM, Kieran Healy wrote: > Hello, > > I'm running R 2.14.1 on OS X (x86_64-apple-darwin9.8.0/x86_64 (64-bit)), with > version 3.28 of Thomas Lumley's survey package. I was using predict() from > svyglm(). E.g.: > > data(api) > dstrat<-svydesign(id=~1,strata=~stype, w

[R] survey package svystat objects from predict()

2012-02-13 Thread Kieran Healy
Hello, I'm running R 2.14.1 on OS X (x86_64-apple-darwin9.8.0/x86_64 (64-bit)), with version 3.28 of Thomas Lumley's survey package. I was using predict() from svyglm(). E.g.: data(api) dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc) out <- svyglm(sch.wide~ell+mobi

Re: [R] survey package: weights used in svycoxph()

2010-05-18 Thread Thomas Lumley
On Tue, 18 May 2010, Vinh Nguyen wrote: Binder's estimating equations are the usual way of applying weights to a Cox model, so nothing special is done apart from calling coxph(). To quote the author of the survival package, Terry Therneau, "Other formulae change in the obvious way, eg, the weigh

Re: [R] survey package: weights used in svycoxph()

2010-05-18 Thread Vinh Nguyen
On Tue, May 18, 2010 at 8:50 AM, Thomas Lumley wrote: > >  > I >> >> don't believe so since svycoxph() calls coxph() of the survival >> package and weights are applied once in the estimating equation.  If >> the weights are implemented in the ratio, could you point me to where >> in the code this

Re: [R] survey package: weights used in svycoxph()

2010-05-18 Thread Thomas Lumley
On Mon, 17 May 2010, Vinh Nguyen wrote: Dear R-help, Let me know if I should email r-devel instead of this list. This message is addressed to Professor Lumley or anyone familiar with the survey package. Does svycoxph() implement the method outlined in Binder 1992 as referenced in the help fil

[R] survey package: weights used in svycoxph()

2010-05-17 Thread Vinh Nguyen
Dear R-help, Let me know if I should email r-devel instead of this list. This message is addressed to Professor Lumley or anyone familiar with the survey package. Does svycoxph() implement the method outlined in Binder 1992 as referenced in the help file? That is, are weights incorporated in th

[R] survey package: weights used in svycoxph()

2010-05-17 Thread Vinh Nguyen
Dear R-help, Let me know if I should email r-devel instead of this list.  This message is addressed to Professor Lumley or anyone familiar with the survey package. Does svycoxph() implement the method outlined in Binder 1992 as referenced in the help file?  That is, are weights incorporated in th

Re: [R] survey package question

2010-02-18 Thread Thomas Lumley
On Thu, 18 Feb 2010, Richard Valliant wrote: Should the svyby function be able to work with svyquantile? I get the error below ... It works, but you need to either specify ci=TRUE or keep.var=FALSE. The problem is that svyquantile() by default does not produce standard errors. svyby(~api0

[R] survey package question

2010-02-18 Thread Richard Valliant
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.

Re: [R] Survey Package with Binary Data (no Standard Errors reported)

2009-04-06 Thread Thomas Lumley
On Fri, 3 Apr 2009, Paul Jones wrote: Hi, I'm trying to get standard errors for some of the variables in my data frame. One of the questions on my survey is whether faculty coordinate across curriculum to include Arts Education as subject matter. All the responses are coded in zeros and ones

[R] Survey Package with Binary Data (no Standard Errors reported)

2009-04-03 Thread Paul Jones
Hi, I'm trying to get standard errors for some of the variables in my data frame. One of the questions on my survey is whether faculty coordinate across curriculum to include Arts Education as subject matter. All the responses are coded in zeros and ones obviously. For some of the other varia

[R] survey package

2008-09-25 Thread Sylvie Ahoussou
Hello I have a problem using the package survey: I'm trying to calculate the prevalence of a disease in animals sampled using a 2 stages sampling system: first level: farm randomly chosen within 551 farms second level: animals randomly chosen in the farms My data base has this aspect:

Re: [R] survey package: proportion estimate confidence intervals using svymean

2008-02-13 Thread Thomas Lumley
On Tue, 12 Feb 2008, Peter Holck wrote: > Using the survey package I find it is convenient and easy to get estimated > proportions using svymean, and their corresponding estimated standard > errors. But is there any elegant/simple way to calculate corresponding > confidence intervals for those pr

[R] survey package: proportion estimate confidence intervals using svymean

2008-02-13 Thread Peter Holck
Using the survey package I find it is convenient and easy to get estimated proportions using svymean, and their corresponding estimated standard errors. But is there any elegant/simple way to calculate corresponding confidence intervals for those proportions? Of course +/- 1.96 s.e. is a reasonab

[R] Survey package question

2007-09-18 Thread eugen pircalabelu
Good afternoon! 1 I have a bit of a problem with the Survey package, but one that is more theoretical than practical. If for example on wishes to use some additional information which comprises of 4 variables with 7, 5,5 and 5 categories (resulting in 875 post-strata if the whole crossin