Displaying 20 results from an estimated 8000 matches similar to: "How to create strata out of the data.frame table"
2012 Feb 01
1
package sampling, function strata
Dear all,
I have to select 122 stratified random samples from a population of
>3900 cells. I have 41 strata and I have to draw a different number of
samples from them(between 2 and 8).
I have tried to apply the funtion strata following the instruction in
the manual:
strata(dataframe, stratanames=NULL, size, method=c("srswor"),
pik,description=TRUE)
but I get the error
2006 Mar 24
1
Clustering over strata using a Cox proportional hazard model
Hi all,
I wish to do build discrete choice model to analyse habitat selection of
wolverines.
This can be done with a 'tricked' stratified Cox proportional hazard
model.
For each individual animal each selected position, and possible
alternative non-used available positions are combined into strata.
This means that one stratum contains a set of 1 used position and
several positions which
2009 Jul 12
2
strata -- really slow performance
I'm a bit confused why the following command is taking an extrodinarily
long time (> 2-3 hours) to run on an 3.06ghz iMac (brand new). I'm
trying to do a stratified random sample, drawing only a single value per
UniqueID from the patch_summary data frame:
uniqueids <- unique(patch_summary$UniqueID)
uniqueids_stratasize <- c(1:length(uniqueids))*0+1
2005 Oct 27
1
Repost: Examples of "classwt", "strata", and "sampsize" i n randomForest?
"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.
2011 Oct 13
1
bootstrap means by strata
All -
I have an uneven set of replicates and would like to sample from this set X number of times to generate a mean for each grouping variable. I was thinking the boot package would be the thing to use, but now I'm not so sure ... given the discussion here:
http://finzi.psych.upenn.edu/Rhelp10/2010-June/243828.html
Given these data (a small subset):
> dput(x)
structure(list(numSpp
2009 Oct 27
2
cox regression extract strata as numeric
Hi there,
I perform a stratified cox and then I need the strata as a numeric array "straft.ln"
ft.ln <- coxph(Surv(times,deaths)~ages+chemos+chemos:f1+chemos:f2+horms+horms:f1+horms:f2+grades+grades:f1+grades:f2+positives+positives:f1+positives:f2+sizes+sizes:f1+sizes:f2+strata(stra),data=ddd)
basehazzft.ln=basehaz(ft.ln,centered=FALSE)
H0ft.ln=c(basehazzft.ln[,1])
2011 Mar 10
1
ANOVA for stratified cox regression
This is a follow-up to a query that was posted regarding some problems that
emerge when running anova analyses for cox models, posted by Mathias Gondan:
Matthias Gondan wrote:
>* Dear List,*>**>* I have tried a stratified Cox Regression, it is working fine, except for*>* the "Anova"-Tests:*>**>* Here the commands (should work out of the box):*>**>*
2008 Jan 15
1
Anova for stratified Cox regression
Dear List,
I have tried a stratified Cox Regression, it is working fine, except for
the "Anova"-Tests:
Here the commands (should work out of the box):
library(survival)
d = colon[colon$etype==2, ]
m = coxph(Surv(time, status) ~ strata(sex) + rx, data=d)
summary(m)
# Printout ok
anova(m, test='Chisq')
This is the output of the anova command:
> Analysis of Deviance Table
2009 Mar 28
1
stratified variables in a cox regression
>Hello,
I am hoping for assistance in regards to examining the contribution
of stratified variables in a cox regression. A previous post by Terry
Therneau noted that "That is the point of a strata; you are declaring
a variable to NOT be proportional hazards, and thus there is no
single "hazard ratio" that describes it". Given this purpose of
stratification, in the
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
2005 May 26
1
Survey and Stratification
Dear WizaRds,
Working through sampling theory, I tried to comprehend the concept of
stratification and apply it with Survey to a small example. My question
is more of theoretic nature, so I apologize if this does not fully fit
this board's intention, but I have come to a complete stop in my efforts
and need an expert to help me along. Please help:
age<-matrix(c(rep(1,5), rep(2,3),
2008 Apr 07
2
basehaz and newdata
I am unable to get the basehaz function to apply a proportional
hazards model to a new data frame. I replicated my specific situation
with the example for coxph in the help, where I changed the x value of
the first record from 0 to 1. Is there something incorrect in the
syntax that I am using? Thanks in advance!
test1 <- list(time= c(4, 3,1,1,2,2,3),
status=c(1,NA,1,0,1,1,0),
2010 Jun 10
1
coxph and completely missing strata/subsetting
Hi everyone,
I'm doing some coxph() analyses with a large and complex dataset. The data was collected in different centers, so I am using strata(centers) to stratify the analysis.
My main issue is, not all centers collected all the variables, so for a model such as:
coxph(Surv(days, cancer) ~ varA + sex + strata(centers), data)
I might have 1 or more centers that have NA for varA (in
2011 Jun 26
2
how to extract data from a function printout - example provided
Hi there,
Does anyone know how to extract data from a function that prints out two or more summaries? In the function below (the whole code is provided) we get 5 different tables of data. I would like to split each of these tables in a separate file (while the function itself shouldn't be changed), so that further analysis on each data set could be carried out. Your help is deeply
2012 Oct 14
1
Problems with coxph and survfit in a stratified model, with interactions
First, here is your message as it appears on R-help.
On 10/14/2012 05:00 AM, r-help-request@r-project.org wrote:
> I?m trying to set up proportional hazard model that is stratified with
> respect to covariate 1 and has an interaction between covariate 1 and
> another variable, covariate 2. Both variables are categorical. In the
> following, I try to illustrate the two problems that
2009 May 18
3
Runtime Error! Keep on happening while using amap, anacor and ca pckg
Hi there dear R users,
Does anyone have any idea what the following error means and how to sort
it out?
Runtime Error!
Program: C\Program Files\R\R-2.9.0\bin\Rgui.exe
This application has requested the Runtime to terminate it in an unusual
way. Please contact the application’s support team for more information.
Here is the story:
Running the same code, sometimes the error happens and other
2005 Apr 29
0
problem with strata in boot
Hello,
I am new to R, and am having trouble running a stratified bootstrap.
My data set consists of 38 study sites in which I recorded the number
of bird pairs. Each site has been classified as burned or mowed and
for each of these two strata I would like to determine the precision
of an overall density estimate. I can run an unstratified bootstrap
without problem, but when I specify the strata I
2005 May 04
1
stratified bootstrap with boot
Hello,
I am new to R, and am having trouble getting the output I want from a
stratified bootstrap. I didn't recieve a reply the first time I posted
this question so I have tried to make it more clear. My data frame
(denboot) is set up as follows:
SITE cswa parea treat
1 BeanA 3 1.20 m
2 BeanBC 3 1.05 m
3 BeanD 1 0.93 m
4 BlackB 1 1.01
2013 Apr 26
1
Stratified Random Sampling Proportional to Size
Hello R Experts,
I kindly request your assistance on figuring out how to get a stratified random sampling proportional to 100.
Below is my r code showing what I did and the error I'm getting with sampling::strata
# FIRST I summarized count of records by the two variables I want to use as strata
Library(RODBC)
library(sqldf)
library(sampling)
#After establishing connection I query the data
2001 Nov 01
1
Stratified study.
Hello,
I am analyzing the results of a survey of the student body on the use of
certain technologies. The student body was divided in strata according to
two criteria, college and user class. The resulting 24 strata were sampled.
Subjects filled out a survey with a number of questions, most of them of
the yes-no variety. I created a data.frame with the results for the survey.
One row for