search for: strata

Displaying 20 results from an estimated 153 matches for "strata".

Did you mean: stata
2011 Jan 25
2
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...
2008 Dec 04
1
Comparing survival curves with "survdiff" "strata" help
ExpeRts, I''m trying to compare three survival curves using the function "survdiff" in the survival package. Following is my code and corresponding error message. > survdiff(Surv(st_months, status) ~ strata(BOR), data=mydata) Error in survdiff(Surv(st_months, status) ~ strata(BOR), data = mydata) : No groups to test When I check the "strata" of the variable. I get . . . > strata(BOR) Levels: BOR=PD BOR=PR BOR=SD So I know there are levels associated with the BOR variable, but I can...
2003 Feb 12
2
Various Errors using Survey Package
...imenting with the new Survey package. Specifically, I was trying to use some of the functions on the public-use survey data from NHIS (2000 Sample Adult file). Error 1): The first error I get is when I try to specify the complex survey design. nhis.design<-svydesign(ids=~psu, probs=~probs, strata=~strata, data=nhis.df, check.strata=TRUE) Error in svydesign(ids = ~psu, probs = ~probs, strata = ~strata, data = nhis.df, : Clusters not nested in strata My data are sorted by strata, psu. Can someone tell me what the structure has to be for a stratified sample with clustering? Lookin...
2013 Dec 07
2
combine glmnet and coxph (and survfit) with strata()
Dear All, I want to generate survival curve with cox model but I want to estimate the coefficients using glmnet. However, I also want to include a strata() term in the model. Could anyone please tell me how to have this strata() effect in the model in glmnet? I tried converting a formula with strata() to a design matrix and feeding to glmnet, but glmnet just treats the strata() term with one independent variable... I know that if there is no such s...
2018 May 08
0
Fitting problem for Cox model with Strata as interaction term
...37 1 1643 1468 > xtabs(~status+tgroup+SEX, data) , , SEX = 1 tgroup status 1 2 3 0 3035 2403 1326 1 759 458 426 , , SEX = 2 tgroup status 1 2 3 0 2596 1940 1001 1 701 476 291 > fit1 <- coxph(Surv(tstart, time, status) ~ *SEX:strata(tgroup)*, data=data) Warning message: In coxph(Surv(tstart, time, status) ~ SEX:strata(tgroup), data = data) : X matrix deemed to be singular; variable 2 4 6 > fit1 Call: coxph(formula = Surv(tstart, time, status) ~ SEX:strata(tgroup), data = data) coef exp(...
2017 Dec 28
1
Why aov() with Error() gives three strata?
Dear list users, I am trying to learn Repeated measures ANOVA using the aov() interface, but I'm struggling to understand its output. According to tutorials on the web, formula for a repeated measures design is: aov(Y ~ IV+ Error(SUBJECT/IV) ) This formula does work but it returns three strata (Error:SUBJECT, Error: SUBJECT:IV, Error: Within), when I would expect two strata (Within and Between subjects). I've seems some tutorials show the exactly same setup, but returning only the two first strata. Is it possible to have two or three strata depending on the data? If there is always...
2008 Jul 16
3
Stratified random sample
An embedded and charset-unspecified text was scrubbed... Name: n?o dispon?vel URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080716/4aec957e/attachment.pl>
2017 Dec 28
1
Why aov() with Error() gives three strata?
...n Repeated measures ANOVA using the aov() interface, but > I'm struggling to understand its output. > > According to tutorials on the web, formula for a repeated measures design > is: > > aov(Y ~ IV+ Error(SUBJECT/IV) ) > > This formula does work but it returns three strata (Error:SUBJECT, Error: > SUBJECT:IV, Error: Within), when I would expect two strata (Within and > Between subjects). I've seems some tutorials show the exactly same setup, > but returning only the two first strata. > > Is it possible to have two or three strata depending on the...
2008 Sep 12
2
Fw: Complex sampling survey _ Use of survey package
...; 2070 S 551 9 52 > > > > yes Totanim is the total number of animals in the farm and num is the > total number of herds > > I keep on obtaining this error message > > clustot<-svydesign(id=~num+ ~ Id_An, fpc=~fpc1+~Totanim, data=tab1) > > Erreur dans as.fpc(fpc, strata, ids) : > FPC implies >100% sampling in some strata. > > > -------------------------------------------------- > From: "Thomas Lumley" <tlumley at u.washington.edu> > Sent: Friday, September 12, 2008 12:02 AM > To: "Ahoussou Sylvie" <sylvie.ahous...
2005 Oct 04
2
"Survey" package and NAMCS data... unsure of specification
...) 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 NAMCS describes this for Stata as follows (note the variable names in the data are in caps): The pweight (PATWT), strata (CSTRATM), and PSU (CPSUM) are set with the svyset command as follows: svyset pweight PATWT svyset strata CSTRATM svyset psu CPSUM They provide similar instructions for SUDAAN: as SUDAAN 1-stage WR Option The program below provides a with replacement ultimate cluster (1-stage) estimate of standar...
2010 Jan 19
5
restricted permutations in permtest()?
...orm test anova(mod) ##simulation of dependence; blocks blocks<-factor(c(rep(1,4),rep(2,4),rep(3,4),rep(4,4))) ##the unrestricted Permutation test for F is permutest(mod, pairwise = TRUE) ..I wasn''t able to find out the right syntax for implementation of blocks, I tried with argument strata, which would be blocks, in permutest(mod, pairwise = TRUE, blocks) but this doesn''t work. By the way, what is ''pairwise = TRUE'' for? Thanks for any help, Kay --------------------------------------------- Mag. Kay Cichini Institute of Botany Sternwartestr. 15 A-6020 Inn...
2005 Oct 27
1
Repost: Examples of "classwt", "strata", and "sampsize" i n randomForest?
...t;classwt" in the current version of the randomForest package doesn''t work too well. (It''s what was in version 3.x of the original Fortran code by Breiman and Cutler, not the one in the new Fortran code.) I''d advise against using it. "sampsize" and "strata" can be use in conjunction. If "strata" is not specified, the class labels will be used. Take the iris data as an example: randomForest(Species ~ ., iris, sampsize=c(10, 30, 10)) says to randomly draw 10, 30 and 10 from the three species (with replacement) to grow each tree. If...
2011 Jul 10
1
Package "survival" --- Difference of coxph strata with subset?
[code]>require("survival") > coxph(Surv(futime,fustat)~age + strata(rx),ovarian) Call: coxph(formula = Surv(futime, fustat) ~ age + strata(rx), data = ovarian) coef exp(coef) se(coef) z p age 0.137 1.15 0.0474 2.9 0.0038 Likelihood ratio test=12.7 on 1 df, p=0.000368 n= 26, number of events= 12 > coxph(Surv(futime,fustat)~age, ovarian, s...
2005 Mar 04
3
Basic stratification calculations
Hi. I''m a student at SFU in Canada. The basic thing I want to do is calculate means of different strata. I have 2 vectors. One has the values I want to take the means from, the other is the four strata I am interested in. So I essentially want to break up the information vector into the four strata and calculate four means, one for each stratum. How can I do this in a reasonable way? Thanks very mu...
2017 Dec 28
1
Why aov() with Error() gives three strata?
...erface, > but > > I'm struggling to understand its output. > > > > According to tutorials on the web, formula for a repeated measures design > > is: > > > > aov(Y ~ IV+ Error(SUBJECT/IV) ) > > > > This formula does work but it returns three strata (Error:SUBJECT, Error: > > SUBJECT:IV, Error: Within), when I would expect two strata (Within and > > Between subjects). I've seems some tutorials show the exactly same > setup, > > but returning only the two first strata. > > > > Is it possible to have two or...
2009 Oct 01
13
Re: How to use Subpopulation data?
...r Helpers   I have a sample frame and i have sampled from it using three methods and now i want to calculate the statistics but i only get the population parameters.   H <- matrix(rnorm(100, mean=50000, sd=5000)) sampleframe=data.frame(type=c(rep("H",100)),value=c(H)) sampleframe   str=strata(sampleframe,c("type"),size=c(20,), method="srswor") sample.strat<-getdata(sampleframe,str) sample.strat length(H) i get:   length(H) [1] 100 Desire to get: length(H) [1] 20   Best Regards     [[alternative HTML version deleted]]
2017 Dec 29
1
Why aov() with Error() gives three strata?
...t; I'm struggling to understand its output. >>> >>> According to tutorials on the web, formula for a repeated measures design >>> is: >>> >>> aov(Y ~ IV+ Error(SUBJECT/IV) ) >>> >>> This formula does work but it returns three strata (Error:SUBJECT, Error: >>> SUBJECT:IV, Error: Within), when I would expect two strata (Within and >>> Between subjects). I've seems some tutorials show the exactly same >> setup, >>> but returning only the two first strata. >>> >>> Is it poss...
2011 Mar 01
1
glht() used with coxph()
...39;'Tukey'')) General Linear Hypotheses Multiple Comparisons of Means: Tukey Contrasts Linear Hypotheses: Estimate pyridoxine - placebo == 0 -0.06303 thiotepa - placebo == 0 -0.15885 thiotepa - pyridoxine == 0 -0.09582 However, once I added a strata term in the formula of coxph(), then glht() can''t work anymore: > (fit<-coxph(Surv(stop, status>0)~treatment+strata(enum),bladder1)) coxph(formula = Surv(stop, status > 0) ~ treatment + strata(enum), data = bladder1) coef exp(coef) se(coef) z...
2005 Aug 28
11
stratified Wilcoxon available?
Dear All, is there a stratified version of the Wilcoxon test (also known as van Elteren test) available in R? I could find it in the survdiff function of the survival package for censored data. I think, it should be possible to use this function creating a dummy censoring indicator and setting it to not censored, but may be there is a better way to perform the test. Thanks, Heinz T??chler
2003 Jan 07
2
Extracting means for given strata from dissimilarity object
Is there a way of extracting mean distance or dissimilarity for a given strata from a ''dist'' or ''dissimilarity'' object, e.g. extract mean distances for each species in Anderson''s iris data? data(iris) iris.dist<-dist(iris[,1:4]) then what? Mikkel Grum, PhD Genetic Diversity Scientist International Plant Genetic Resources...