similar to: survey package

Displaying 20 results from an estimated 200 matches similar to: "survey package"

2008 Sep 11
1
Complex sampling survey _ Use of survey package
Hello everybody I don't understand how I'm supposed to use svydesign caracteristics to explain to R that my sampling design is the following one Data base = tab1 here are the five first rows of the database (nrow = 11792) num esp Quarters Totcat Totshp Totgt Tbtpos fpc1 Totanim Id_An 10 2045 G
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
2012 May 14
1
Post stratification weights in survey package in R
Hi all, I have data collected from a survey administered on a subset of the population. I also have the population proportions of variables such as gender, race and housing type. I would like to combine the weights from each separate cross tab (of gender, race and housing type) such that the weighted proportions of my survey data matches that of the population. I have tried the following:
2005 Oct 09
1
enter a survey design in survey2.9
Hi dears, I expect that Mr Thomas Lumley will read this message. I have data from a complexe stratified survey. The population is divide in 12 regions and a region consist to and urban area and rural one. there to region just with urbain area. stratification variable is a combinaison of region and area type (urban/rural) In rural area, subdivision are sample with probabilties proporionnal to
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
2012 Oct 03
2
Creating tiff with 1200 dpi
Hi all, I am trying to create images in R suitable for journal publication. I'd like to make an image that is 3.6" wide and 5.08" length, and 1200 dpi. When I create a tiff file that is 800 dpi and 4x4", it works (although doesn't look good). But when I create a tiff that is the size and dpi I want, it doesn't work. I get the following error: Error in tiff(filename =
2011 Aug 23
1
pMCMC and HPD in MCMCglmm
Dear R users, I?d like to pose aquestion about pMCMC and HDP. I have performed a mixed logistic regression by MCMCglmm (a very good package) obtaining the following results: Iterations = 250001:799901 Thinning interval = 100 Sample size = 5500 DIC: 10.17416 G-structure: ~ID_an post.mean l-95% CI u-95% CIeff.samp ID_an 0.7023 0.0001367 3.678 2126 R-structure: ~units post.mean l-95%
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 <-
2012 Dec 14
1
format.pval () and printCoefmat ()
Hi List, My goal is to force R not to print in scientific notation in the sixth column (rel_diff - for the p-value) of my data frame (not a matrix). I have used the format.pval () and printCoefmat () functions on the data frame. The R script is appended below. This issue is that use of the format.pval () and printCoefmat () functions on the data frame gives me the desired results, but coerces
2007 May 17
1
creating columns
l would like to create the following matrice treatmentgrp strata 1 1 1 1 1 1 1 2 1 2 1 2 2 1 2 1 2 1 2 2 2 2 2 2 l should be able to choose the size of the treatment grps and stratas the method l used intially creates the
2010 Dec 11
2
package sampling
Hi R users. I have a problem with function strata in sampling packages. > st0 = strata(dom, stratanames="stratas", size=sample.size, method="systematic",pik, FALSE) Error in sort.list(y) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list? In previous version of R 2.9.1 and previous version of package sampling this code worked
2011 Aug 05
1
Goodness of fit of binary logistic model
Dear All, I have just estimated this model: ----------------------------------------------------------- Logistic Regression Model lrm(formula = Y ~ X16, x = T, y = T) Model Likelihood Discrimination Rank Discrim. Ratio Test Indexes Indexes Obs 82 LR chi2 5.58 R2 0.088 C 0.607 0
2011 Jan 25
1
NA replacing
Hello R user, I have following data frame: df=data.frame(id=c(1:10),strata=rep(c(1,2),c(5,5)),y=c( 10,12,10,NA,15,70,NA,NA,55,100),x=c(3,4,5,7,4,10,12,8,3,15)) and I would like to replace NA's with: instead of first NA tapply(na.exclude(df)$y,na.exclude(df)$strata,sum)[1]* *7 */tapply(na.exclude(df)$x,na.exclude(df)$strata,sum)[1] where 7 is the value of x (id=4) in strata 1 where y=NA
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
2017 Aug 04
2
Why is as.function() slower than eval(call("function"())?
(Apologies if this is better suited for R-help.) On my system (macOS Sierra, late 2014 MacBook Pro; R 3.4.1, Homebrew build), I found that it is faster to construct a function using eval(call("function", ...)) than using as.function(list(...)). Example: make_fn_1 <- function(a, b) eval(call("function", a, b), env = parent.frame()) make_fn_2 <- function(a, b)
2011 May 12
6
[Bug 1905] New: check_parent_exists() logic does not cover all cases
https://bugzilla.mindrot.org/show_bug.cgi?id=1905 Summary: check_parent_exists() logic does not cover all cases Product: Portable OpenSSH Version: 5.8p2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: ssh-agent AssignedTo: unassigned-bugs at mindrot.org
2010 Jan 11
3
interpolation
Dear R-users, I have a complex line by xy-values (ordered by z). And I would like to get interpolated y-values on the positions of x = 0:600. How do I get the correct points? x=c(790,790,790,790,790,786,783,778,778,766,763,761,761,761,715,628,521,350,160,134,134,129,108,101,93,111,161,249,288,243,139,45,7)
2009 Jun 02
10
Most used R editors
Hi, I am a little lonely as R users in my group. So, I would like to know which editor is the most used in the R community. This post is some kind of survey. Personally, I use Emacs with ESS, It permits to : - open more than one R session - split the emacs editor as many part as you want. - use a lot of keybindings. ... I also tried Rkwards, Scilab (windows), JGR etc... but they are not
2013 Apr 06
5
arrange data
Hello all! I have a problem to arrange data in another form. My initial data is like this: 'data.frame': 421 obs. of 58 variables: $ 01A: num NA NA NA NA NA NA NA NA NA NA ... $ 01B: num NA NA NA NA NA NA NA NA NA NA ... $ 03A: num NA NA NA NA NA NA NA NA NA NA ... $ 03B: num NA NA NA NA NA NA NA NA NA NA ... $ 05A: num NA NA NA NA NA NA NA NA NA NA ... $ 05B: num NA NA NA NA