survey

F argument of survey package does not give expected output

佐手、 提交于 2020-08-10 20:13:48
问题 Follow up on R's survey package interpolation handling for median estimates, which has not attracted many feedback. I have managed to boil down the issue to the following: I'm using R's survey package to get the median estimation for a set of data. The data to replicate this issue is available as a dput text here. The design I'm using is a class svyrep.design defined as the following: design <- svydesign(id = ~id_directorio, strata = ~estrato, weights = ~f_pers, check.strata = TRUE, data =

R's survey package interpolation handling for median estimates

两盒软妹~` 提交于 2020-06-29 03:57:12
问题 I'm reposting the question asked here hoping maybe to get a little more visibility. This is a question concerning Lumley's survey package for R. Specifically, its handling of interpolation for median estimation, after several hours of looking into the matter. I'm using a svyrep design which has the following form: design <- svydesign(id = ~id_directorio, strata = ~estrato, weights = ~f_pers, check.strata = TRUE, data = datos) options(survey.lonely.psu="remove") set.seed(234262762) SB2K_2 = as

R's survey package interpolation handling for median estimates

Deadly 提交于 2020-06-29 03:57:09
问题 I'm reposting the question asked here hoping maybe to get a little more visibility. This is a question concerning Lumley's survey package for R. Specifically, its handling of interpolation for median estimation, after several hours of looking into the matter. I'm using a svyrep design which has the following form: design <- svydesign(id = ~id_directorio, strata = ~estrato, weights = ~f_pers, check.strata = TRUE, data = datos) options(survey.lonely.psu="remove") set.seed(234262762) SB2K_2 = as

Getting a subset error I did not get two months ago when running logistic regression (svyglm) on survey data (SPSS dataset)

我怕爱的太早我们不能终老 提交于 2020-06-28 04:00:07
问题 I re-run script that previously worked with no errors about two months ago. I used the haven package to upload an (non-public and proprietary) SPSS dataset and the survey package to analyze complex survey data. Now, however, when I run even a simple logistic regression where both variables are dummies (coded 0 for no and 1 for yes)...something like this... f <- read_sav("~/data.sav") fsd <- svydesign(ids=~1, data=f, weights=~f$weight) model <- svyglm(exclhlth~male,design=fsd,family

Which C++ logical operators do you use: and, or, not and the ilk or C style operators? why? [closed]

北城以北 提交于 2020-02-03 04:16:23
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . leisure/curiosity question as implied in the title. I personally prefer the new operators as to make code more readable in my opinion.

Filtering na or missing value rows(observations) out from multiple imputation list

谁都会走 提交于 2020-01-25 10:52:29
问题 (EDIT: totally refined question) using package mitools & survey and followiing Anthony Damico's code, I am working with Survey of Consumer Finance dataset for several days. original list of datasets is "scf_imp", and the imputation imposed list of datasets is "scf_design". The problem is the following: 5 multiple imputation data frames have different columns and therefore if I make a subset of samples with that column variable ("houses" in my case), data frames with missing value in that

Compute quantiles incorporating Sample Design (Survey package)

不羁岁月 提交于 2020-01-21 10:35:17
问题 I want to compute a new column using the quantiles of another column (a continuous variable) incorporating the Sample Design of a complex survey. The idea is to create in the the data frame a new variable that indicates which quantile group each observation falls into Here is how I execute the idea without incorporating the sample design, so you can understand what I'm aiming for. # Load Data data(api) # Convert data to data.table format (mostly to increase speed of the process) apiclus1 <-

“Incorrect username or password” error message in Qualtrics API v2.5

雨燕双飞 提交于 2020-01-17 03:04:35
问题 Due to some features that I wish were available in Qualtrics v3 (see previous post), I checked out their most recent previous version (v2.5) to try to find a GET request which closely approximates the data from individual surveys that I'm trying to obtain on each request. However, when I do their built-in API test on my own credentials: I get the following error: <XML> <Meta> <Status>Error</Status> <RequestType>getSurvey</RequestType> <ErrorCode>500</ErrorCode> <QualtricsErrorCode>ESRV09<

Error using dynamic variable specification in R survey function svychisq()

混江龙づ霸主 提交于 2020-01-06 14:44:10
问题 I am using the functions in the R survey -library, and per this example on Stackoverflow, I use bquote() and as.name() to dynamically construct the formula for specifying the variables. This works fine for svytable() , but not for svychisq() . For example: library(survey) data(api) dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc) colvar <- 'sch.wide' rowvar <- 'awards' svytable(bquote(~.(as.name(rowvar)) + .(as.name(colvar)) ), dstrat) sch.wide awards No Yes No