Displaying 20 results from an estimated 1200 matches similar to: "Advice on package design for handling of dots in a formula"
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 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 23
0
multi-stage sampling and hierarchical models: which packages?
Dear wizaRds,
I have a dataset to analyse which is causing me problems. It is a sample of
parents in schools. First we had a population table of the schools in the
country in question divided into five regions, and in each region we have an
urban/rural split. The population Ns in these ten cells are known. Then
three schools were drawn from each cell according to the Lahirie method, i.e
with
2005 Oct 04
1
"Survey" package and NAMCS data... unsure of specification
Hello, all.
I wanted to use the "survey" package to analyze data from the National
Ambulatory Medical Care Survey, and am having some difficulty translating
the analysis keywords from one package (Stata) to the other (R). The data
were collected using a multistage probability sampling, and there are
variables included to identify the sampling units and weights. Documentation
from the
2010 Jun 22
1
Labels for matplot x axis
Hi all, I've been messing with this for a while now..
myStudy is a matrix of word frequency to date of document/document.
As you can see I'm trying to plot the series in the matrix.
I'd like three things --
1- In the plot that gets created the first series is a solid line, the rest
are dashed... how do I make them either one or the other.
2- The legend that comes up has filled boxes
2008 Aug 06
1
Warning when using survey:::svyglm
Howdy,
Referencing the below exchange:
https://stat.ethz.ch/pipermail/r-help/2006-April/103862.html
I am still getting the same warning ("non-integer #successes in a
binomial glm!") when using svyglm:::survey. Using the API data:
library(survey)
data(api)
#stratified sample
dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
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,
2002 Nov 09
2
Nonlinear regression and categories
Hi there:
I'm trying to run a large number of nonlinear regressions on a time
series dataset, where the data will be formatted something to the effect of:
ObservationID,time,dependentvar
I'll have a number of time and dependentvars for each observation, and I
want to apply a nonlinear regression to one ObservationID at a time, and I
want to have a dataset that is the parameter
2012 Feb 13
1
survey package svystat objects from predict()
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+mobility, design=dstrat,
family=quasibinomial())
pred.df <-
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 Jun 21
4
crosstable and regression for survey data (weighted)
I have survey data that I am working on. I need to make some multi-way tables
and regression analyses on the data. After attaching the data, this is the
code I use for tables for four variables (sweight is the weight variable):
> a <- xtabs(sweight~research.area + gender + a2n2 + age)
> tmp <- ftable(a)
Is this correct? I don't think I need to use the strata and cluster
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
2009 Dec 07
0
zelig logit survey
When I use zelig to compute parameter estimates with "model = logit.survey",
I receive the following error:
Nicholas Carnes. 2007. "logt.surveyWarning message:
In eval(expr, envir, enclose) : non-integer #successes in a binomial glm!
I believe this is because the model is not using "quasibinomial" (see R-News
2003, Analyzing Survey Data in R, by Thomas Lumley). Is there
2010 Sep 17
2
[LLVMdev] Support for ARM Run-Time ABI
Dear all,
I just sent a patch to llvm-commits about ARM RT-EABI support when
choosing "arm/thumb*-eabi-*" triple.
It involves three changes described in the path:
1. Floating point helpers (instead of GNU ones). This is supported by
GCC as well, in EABI mode.
2. Reminder lowering, using ABI helper too.
3. Memset, changing the order of arguments, as required by the ABI.
Please
2018 Mar 22
1
exporting data to stata
On Thu, Mar 22, 2018 at 4:52 AM, Raja, Dr. Edwin Amalraj
<amalraj.raja at abdn.ac.uk> wrote:
> Hi ,
>
> library(foreign)
> write.dta(data1, "data1.dta")
>
> should work.
I don't think so:
> library(foreign)
> example(svydesign)
> write.dta(dstrat, "~/Downloads/foo.dta")
Error in write.dta(dstrat, "~/Downloads/foo.dta") :
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
2010 Apr 27
1
Randomization for block random clinical trials
Hi,
I’m new to R (just installed today) and I’m trying to figure out how to do
stratified randomisation using it. My google search expedition has lead me
to believe that blockrand package will most probably be the answer to it.
I’ve played around with blockrand for awhile and tried the sample code:
library(blockrand)
##stratified by sex
male <- blockrand(n=100,
2010 Sep 17
0
[LLVMdev] Support for ARM Run-Time ABI
Attached is an earlier patch I've been sitting on for clearly way too
long. There are a few differences worth discussing:
* Only these few renamed libcalls are set as AAPCS because other
libcalls may still want to be AAPCS-VFP.
* I have all the comparison CCs backward from you. I don't know
offhand which is correct.
* I put in the long long libcalls as well.
Any or all of these
2017 May 23
0
Allow dot in RHS of update.formula's old formula
Feature request:
I want to use update.formula to subtract an intercept (or other) term from a formula with a dot on the RHS. However, as this causes an error, I propose a patch below.
Thus, I want:
> update.formula(y ~ ., ~ . -1)
[1] y ~ . - 1
Instead I get this error:
Error in terms.formula(tmp, simplify = TRUE) :
'.' in formula and no 'data' argument
While the error
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