Re: [R] I don't understand the result of `svyboxplot` function from the Survey package

2022-08-03 Thread Thomas Lumley
It's a bug resulting from the new svyquantile() implementation. It's fixed in the development version, which you can get from r-forge here: https://r-forge.r-project.org/R/?group_id=1788 -thomas Thomas Lumley Professor of Biostatistics From: Anthony

Re: [R] Can you get the DEFT from svyratio?

2016-12-07 Thread Thomas Lumley
No, you can't (at the moment), though it shouldn't be too hard to extend. I can't run your example, though. I get: Error in eval(expr, envir, enclos) : object 'M' not found -thomas Thomas Lumley Professor of Biostatistics University of Auckland From: Chris

Re: [R] problem when I Call C subfunction in void function

2014-08-27 Thread Thomas Lumley
number (number 4 in my exemple) ? -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] Weighted Mann-Whitney-Wilcoxon-Test

2014-08-19 Thread Thomas Lumley
rank tests under complex sampling. Biometrika, 100, 831-842. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] rake() error message

2014-06-09 Thread Thomas Lumley
list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland

Re: [R] Understanding svymean

2014-06-05 Thread Thomas Lumley
to compute probabilities, which are then used to compute weights. The code works in terms of probabilities because that's fairly standard in textbooks. It makes it easier for me to get the formulas right. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland

Re: [R] Understanding survey design (svydesign)

2014-06-05 Thread Thomas Lumley
the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https

Re: [R] SQL vs R

2014-05-06 Thread Thomas Lumley
on the database backend part of the process. You might try MonetDB and its R interface -- it is fast for aggregation operations, and either the current version or the upcoming version has dplyr support. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland

Re: [R] problem on package survey , function svyglm,

2014-04-16 Thread Thomas Lumley
=L96ludyhFBsC (look for single in the whole book to find it). Or set options(survey.lonely.psu) to one of the other values. But merging strata is probably better. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted

Re: [R] Survey

2014-04-02 Thread Thomas Lumley
the variables in your dataset is to use the database-backed designs and put the data in something like SQLite. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] Problem with do.call().

2014-03-27 Thread Thomas Lumley
http://www.R-project.org/ posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] Overriding predict based on newdata...

2014-03-18 Thread Thomas Lumley
many people would have to understand how they are scoped. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] automatically replacing the third period with a break

2014-03-18 Thread Thomas Lumley
\\2\n, fake ) ) That is, match three word/period sequences, match a word, match a period, and output the first two things. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted

Re: [R] Survfit Error

2014-03-06 Thread Thomas Lumley
. This was a recent (well, 2007) change in behaviour. Previously the function did some tricks to make either approach work, which could be described as 'clever' or 'too clever by half'. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted

Re: [R] SEs rms cph vs survey svycoxph

2014-02-26 Thread Thomas Lumley
anesthetictransfusionunits 0.1964 0.0214 9.17 0.0001 From: Thomas Lumley tlum...@uw.edu Date: Tuesday, February 25, 2014 at 3:09 PM To: Nathan Leon Pace, MD, MStat n.l.p...@utah.edu Cc: r help list r-help@r-project.org Subject: Re: [R] SEs rms cph vs survey svycoxph On Tue, Feb

Re: [R] Discrepant lm() and survreg() standard errors with weighted fits

2014-02-25 Thread Thomas Lumley
as sampling weights. Actually, lm() treats them as precision weights, not sampling weights, but that's still the explanation. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R

Re: [R] SEs rms cph vs survey svycoxph

2014-02-25 Thread Thomas Lumley
with survfit.coxph for independent sampling when the model fits well, but are larger when the model fits poorly. That is, the note is for the survival curve rather than the coefficients. It's still surprising that there's a big difference, but I think we need more information. -thomas -- Thomas

Re: [R] NextMethod in boxcox

2014-02-14 Thread Thomas Lumley
/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted

Re: [R] svyglm error message

2014-02-11 Thread Thomas Lumley
@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland

Re: [R] Weibull selfStart

2014-01-15 Thread Thomas Lumley
this accelerated-failure parametrisation of the Weibull with survreg() in the survival package. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Percentiles for unequal probability sample

2013-11-21 Thread Thomas Lumley
(including quantiles) for unequal-probability samples. -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Inserting 17M entries into env took 18h, inserting 34M entries taking 5+ days

2013-11-04 Thread Thomas Lumley
, and effectively constant average time to query (inverse-Ackerman amortized complexity). -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

Re: [R] Hierarchical Cluster Analysis with large dataset

2013-11-03 Thread Thomas Lumley
-- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] probability weights in multilevel models

2013-06-05 Thread Thomas Lumley
, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] Goodness-of-fit tests for Complex Survey Logistic Regression

2013-05-29 Thread Thomas Lumley
for a month or so). -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Sampling Weights and lmer() update?

2013-05-14 Thread Thomas Lumley
to use sampling weights in the past, but according to post I found online from Thomas Lumley in mid-2012, R is currently not equipped to be able to do this. His post is here: http://r.789695.n4.nabble.com/sampling-weights-for-multilevel-models-tp4632947p4632955.html Does anyone know

Re: [R] Package survey: singularities in linear regression models

2013-05-05 Thread Thomas Lumley
, schrieb Thomas Lumley: On Fri, May 3, 2013 at 2:27 AM, Sebastian Weirich sebastian.weir...@iqb.hu-berlin.de wrote: Hello, I want to specify a linear regression model in which the metric outcome is predicted by two factors and their interaction. glm() computes effects for each factor level

Re: [R] Package survey: singularities in linear regression models

2013-05-02 Thread Thomas Lumley
, and what actually happened, as the posting guidelines request. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] significantly different from one (not zero) using lm

2013-04-30 Thread Thomas Lumley
code. -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Stratified Random Sampling Proportional to Size

2013-04-28 Thread Thomas Lumley
/** posting-guide.html http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R

[R] advert: courses in R use, programming in Seattle

2013-04-25 Thread Thomas Lumley
information at http://www.biostat.washington.edu/suminst/sisg/schedule -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] t-statistic for independent samples

2013-04-17 Thread Thomas Lumley
guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r

Re: [R] Strange error with log-normal models

2013-04-16 Thread Thomas Lumley
' is not lognormal. It is a model with normal errors and log link, ie. y ~ N(mu, sigma^2) log(mu) = x \beta -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] Solving an integral in R gives the error “The integral is probably divergent”

2013-04-12 Thread Thomas Lumley
reproduce the reported error. -thomas -pd On Apr 12, 2013, at 04:51 , Thomas Lumley wrote: I don't get an error message (after I correct the missing line break after the comment b- sapply(a, Cfun, upper=1) b [1] 1.583458e-54 7.768026e-50 2.317562e-45 4.206260e-41

Re: [R] Solving an integral in R gives the error “The integral is probably divergent”

2013-04-11 Thread Thomas Lumley
/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

Re: [R] Weighted Kaplan-Meier estimates with R

2013-03-27 Thread Thomas Lumley
. It shouldn't be too hard to get it to extend that to the last censoring time, but the reason it isn't too hard is that the curve and standard error estimates don't change after the last failure time, so it won't be particularly useful. -thomas -- Thomas Lumley Professor of Biostatistics

Re: [R] Cluster analysis on weighted survey data with continuous and categorical variables

2013-03-19 Thread Thomas Lumley
sample by sampling from it with probability inversely proportional to the original sampling probability. - thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] Superscript followed by number then superscript in text

2013-03-18 Thread Thomas Lumley
: capacity 10^3 m^3 (with ^ denoting superscript (i.e. each '3' as superscript). What did you try? Anyhow, this works text(1,1,expression(capacity~10^3~m^3)) -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted

Re: [R] error: object of type 'closure' is not subsettable

2013-03-14 Thread Thomas Lumley
that there cannot be any ties in the differences. If there are ties, the function uses a Normal approximation. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] (no subject)

2013-03-10 Thread Thomas Lumley
-- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] Zelig package: Coxph model problems

2013-03-05 Thread Thomas Lumley
://www.R-project.org/** posting-guide.html http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted

Re: [R] R encrypt/decrypt

2013-01-09 Thread Thomas Lumley
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version

Re: [R] weighted factor analysis

2013-01-09 Thread Thomas Lumley
the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r

Re: [R] pROC and ROCR give different values for AUC

2012-12-19 Thread Thomas Lumley
in all three cases. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] kruskalmc, significant differences while median values are the same

2012-12-16 Thread Thomas Lumley
at differences in medians. A permutation test or a bootstrap confidence interval is probably the best way to do this. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r

Re: [R] interfacing with .Call

2012-12-16 Thread Thomas Lumley
://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted

Re: [R] Problems with weight

2012-12-04 Thread Thomas Lumley
. -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] ROC Curve: negative AUC

2012-11-22 Thread Thomas Lumley
whether there's some strange non-convexity going on or whether the variable is just being put into the calculations backwards. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted

Re: [R] R-Square in WLS

2012-11-18 Thread Thomas Lumley
to the sum square total in both the Y scale and Z scale. Y is a normal distribution and Z is log normally distributed. Where is the error? Also, is there a way to calculate the weighted sum square? -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland

Re: [R] How to fix it?

2012-11-18 Thread Thomas Lumley
at all if yyrandom[1] is more of a problem. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] standard error for quantile

2012-11-12 Thread Thomas Lumley
or other order statistic and thus write down an integral that gives the exact variance. Better still, it's a polynomial, so you could evaluate the integral exactly. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted

Re: [R] the results of the SORT function differ from Scilab/Matlab for Complex Numbers

2012-11-08 Thread Thomas Lumley
the branch cut goes on the phase coordinate. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] system is computationally singular: reciprocal condition number

2012-10-25 Thread Thomas Lumley
in the fourth decimal place, the matrix stops being singular. -thomas -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Question about survdiff in for-loop.

2012-10-19 Thread Thomas Lumley
] into the formula with survdiff(eval(bquote(Surv(survival.m, survival) ~ .(names[i]))), data=svsv) Even after you fix that, there's another problem, which is that your code doesn't actually use the result from survdiff() in any way. -thomas -- Thomas Lumley Professor of Biostatistics University

Re: [R] svyplot and svysmooth with hexbin

2012-10-18 Thread Thomas Lumley
, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] how R implement qnorm()

2012-10-18 Thread Thomas Lumley
and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] svyboxplot - library (survey)

2012-10-17 Thread Thomas Lumley
commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Package survey: Compute standard deviations from complex survey designs

2012-10-16 Thread Thomas Lumley
(vv))) api00api99 105.7489 112.8504 ## delta method for standard error of square root of variance sqrt(vcov(vv)[api00,api00]/(4*coef(vv)[api00,api00])) [1] 6.555219 -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland

Re: [R] survey package question

2012-10-11 Thread Thomas Lumley
unit, right? and I am estimating an average among voting units? You want a ratio estimator svyratio(~candidate1, ~totalVotes, design) -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list

Re: [R] get: problem with environments

2012-10-10 Thread Thomas Lumley
the function. -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] get: problem with environments

2012-10-10 Thread Thomas Lumley
-- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal

Re: [R] svyhist

2012-10-08 Thread Thomas Lumley
. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor

Re: [R] svyboxplot - library (survey)

2012-10-01 Thread Thomas Lumley
and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Plotting of regsubsets adjr2 values not correct

2012-09-25 Thread Thomas Lumley
. the simple model just with an intercept and the variable GNI is not shown in the plot, why? You asked for the two best models of each size, so you get the two best models of each size. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland

Re: [R] Three Stage Sampling of categorical variable using 'survey' in R

2012-09-25 Thread Thomas Lumley
information on the individual level we are confident to be able to correct the sample weights for that. That sounds plausible -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https

Re: [R] Regsubsets model selection

2012-09-25 Thread Thomas Lumley
Why have you asked this question three times? -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Exactly Replicating Stata's Survey Data Confidence Intervals in R

2012-09-24 Thread Thomas Lumley
--+--- Male | 47.96.585346.8149.11 Female | 52.04.585350.8953.19 On Sun, Sep 23, 2012 at 4:30 PM, Thomas Lumley tlum...@uw.edu wrote: On Sat, Sep 22, 2012 at 2:51 AM, Anthony Damico ajdam...@gmail.com

Re: [R] Exactly Replicating Stata's Survey Data Confidence Intervals in R

2012-09-23 Thread Thomas Lumley
they aren't] -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] Wilcoxon Test and Mean Ratios

2012-09-20 Thread Thomas Lumley
Harrell comes to mind) like it because they believe stochastic ordering is a reasonable assumption in the problems they work in, not because they think you can do non-parametric testing in its absence. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland

Re: [R] Wilcoxon Test and Mean Ratios

2012-09-19 Thread Thomas Lumley
the shift is in the same direction across the whole distribution. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Trap an error from a function

2012-09-18 Thread Thomas Lumley
for all errors. tryCatch() is also quieter. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] loglogistic survreg

2012-09-17 Thread Thomas Lumley
parametrisation. In a model with only an intercept, that would be exp(intercept). -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] eval(parse(...)) only once in a function

2012-09-17 Thread Thomas Lumley
(df) b - df$str == 12 This saves more time than I expected, about 100ms per evaluation on my computer. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] Paasing values to sqlQuery like SAS macro

2012-09-13 Thread Thomas Lumley
firm=, firms, and date=, begindts, and date =, enddts) lapply(queries, sqlQuery, channel=my.database.connection) will return a list of data frames, one for each set of values. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland

Re: [R] simulate from conditional distribution

2012-09-13 Thread Thomas Lumley
numbers from such a distribution? Not directly, as far as I know, but you can easily simulate X|Xc by transforming uniform random numbers using the inverse CDF, and Y|X=x is univariate Normal with mean linear in x and variance independent of x. -thomas -- Thomas Lumley Professor of Biostatistics

Re: [R] test Breslow-Day for svytable??

2012-08-31 Thread Thomas Lumley
#--- test.statistic dfp.value 1 18.82551 5 0.00207139 (At least I got internal consistency. I see you copied Thomas Lumley, which is a good idea. I'll be happy to get corrected on any point. I'm adding the maintainer of epiR to the recipients.) Yes, that will give internal

Re: [R] sensitivity and specificity in svyglm??

2012-08-16 Thread Thomas Lumley
won't be appropriate for the survey design. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Direct Method Age-Adjustment to Complex Survey Data

2012-08-12 Thread Thomas Lumley
-subset(alldata, !is.na(LBXTC)) design1 - svydesign(id=~SDMVPSU, strata=~SDMVSTRA,nest=TRUE,weights=~WTMEC2YR,data=somedata) svyby(~HI_CHOL,~race+RIAGENDR,design=subset(postStratify(design1,~race+RIAGENDR+agecat,racegenderage),RIDAGEYR=20),svymean,na.rm=TRUE) -thomas -- Thomas Lumley Professor

Re: [R] coxph weirdness

2012-07-26 Thread Thomas Lumley
-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] stepwise in svyglm???

2012-07-25 Thread Thomas Lumley
. The function step() uses AIC. As far as I know, no-one has yet constructed valid analogues of AIC,BIC,CIC, ... under complex sampling (Alastair Scott and I are looking into it), so p-values are the only option, making the process even less useful. - thomas -- Thomas Lumley Professor

Re: [R] Threshold Quantile Regression code CRASHES in R

2012-07-17 Thread Thomas Lumley
() Since the problem seems to be data-dependent, and happens with fairly high frequency, you might want to use trace() to stick some sort of data summary in before the call to rqbr, to see if anything obvious is wrong with the data being passed in before things go wrong. -thomas -- Thomas Lumley

Re: [R] rgamma function

2012-07-16 Thread Thomas Lumley
(); REAL(a)[0]=rgamma(5000,1); PutRNGstate(); UNPROTECT(1); return (a); } - thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] rgamma function

2012-07-15 Thread Thomas Lumley
the ANSI standard actually *required* a diagnostic for the incompatible return types. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] test parallel slopes with svyolr

2012-07-08 Thread Thomas Lumley
I'd be prepared to implement it anyway. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Help with multinomial regression to survey

2012-07-06 Thread Thomas Lumley
. The example on the withReplicates() help page shows how to do this for quantile regression, and it should be similar. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https

Re: [R] GEE with Inverse Probability Weights

2012-07-05 Thread Thomas Lumley
read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https

Re: [R] a problem about WLS

2012-07-04 Thread Thomas Lumley
more than observations with low weight. Your code does the opposite. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] turning R expressions into functions?

2012-06-29 Thread Thomas Lumley
formatted the code in the call to eval(), and the good formatting is how R would print it without any source constraints, so this is probably something to do with the keep.source= argument source(). -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland

Re: [R] GEE with Inverse Probability Weights

2012-06-13 Thread Thomas Lumley
(), design=mydesign) -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] sampling weights for multilevel models

2012-06-10 Thread Thomas Lumley
, you need some other software. I do have longer-term plans to add multilevel modelling capabilities to the survey package, but it's harder than it may appear. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r

Re: [R] V-Cramer in svy

2012-06-10 Thread Thomas Lumley
with the package vcd assocstats but without considering the survey package. You can use svytable() to generate an estimated population table and then feed that to assocstats(). -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland

Re: [R] regsubsets (Leaps)

2012-06-03 Thread Thomas Lumley
, by setting nbest fairly large -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] bigglm binomial negative fitted value

2012-05-31 Thread Thomas Lumley
2 3 4 ...  ..$ : NULL As the help says, the default is predictions of the linear predictor. To get predictions of the probability, use type=response -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r

Re: [R] svychisq??

2012-05-31 Thread Thomas Lumley
= M3_11_AUTOPERCEPCIONSALUDGENERAL) -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] svychisq using two frames

2012-05-24 Thread Thomas Lumley
I may be overthinking this and the answer is much simpler) You don't need to create two new variables; you just need a year variable svychisq(~MyVar+Year, BothYears, statistic=”Chisq”, na.rm= TRUE) tests whether MyVar is independent of Year. -thomas -- Thomas Lumley Professor

Re: [R] Post stratification weights in survey package in R

2012-05-14 Thread Thomas Lumley
structures of the package: if you want to see the weights, use the weights() function. The components of $postStrata are used in standard error computations. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r

Re: [R] Replicate weights in R?

2012-05-11 Thread Thomas Lumley
the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] deparse(substitute(x)) on an object with S3 class

2012-05-03 Thread Thomas Lumley
has been evaluated. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] Very small random effect estimation in lmer but not in stata xtmixed

2012-05-03 Thread Thomas Lumley
the same model. Like SAS, Stata by default assumes that random effects are independent of each other, so your Stata model has correlation between the random effects forced to zero. The R model estimates the correlation, and finds it to be far from zero (-0.69). -thomas -- Thomas Lumley Professor

Re: [R] Forestplot question

2012-05-02 Thread Thomas Lumley
]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Thomas Lumley

  1   2   3   4   5   6   >