Displaying 20 results from an estimated 3000 matches similar to: "Different behavior of model.matrix between R 3.2 and R3.1.1"
2015 Jun 16
1
Different behavior of model.matrix between R 3.2 and R3.1.1
Terry Therneau has been very helpful on r-help but we can't figure out
what change in R in the past months made extra columns appear in
model.matrix when the terms object is subsetted to remove stratification
factors in a Cox model. Terry has changed his logic in the survival
package to avoid this issue but he requires generating a larger design
matrix then dropping columns.
A simple
2019 Oct 04
0
Error in [.terms
Martin,
? There are a couple of issues with [.terms that have bitten my survival code.? At the
useR conference I promised you a detailed (readable) explanation, and have been lax in
getting it to you. The error was first pointed out in a bugzilla note from 2016, by the
way.? The current survival code works around these.
Consider the following formula:
<<testform>>=
2024 May 15
2
Extracting values from Surv function in survival package
OS X
R 4.3.3
Colleagues
I have created objects using the Surv function in the survival package:
> FIT.1
Call: survfit(formula = FORMULA1)
n events median 0.95LCL 0.95UCL
SUBDATA$ARM=1, SUBDATA[, EXP.STRAT]=0 18 13 345 156 NA
SUBDATA$ARM=2, SUBDATA[, EXP.STRAT]=1 13 5 NA 186 NA
SUBDATA$ARM=2, SUBDATA[, EXP.STRAT]=2 5
2024 May 16
1
Extracting values from Surv function in survival package
Hi Dennis,
look at the help page for summary.survfit, the Value n.event.
G?ran
On 2024-05-15 22:41, Dennis Fisher wrote:
> OS X
> R 4.3.3
>
> Colleagues
>
> I have created objects using the Surv function in the survival package:
>> FIT.1
> Call: survfit(formula = FORMULA1)
>
> n events median 0.95LCL 0.95UCL
>
2009 Oct 01
5
How to use Subpopulation data?
Dear 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")
2011 Jan 16
1
Help in Coxme
I am a relative newbie to survival analysis and R in general, but
would like to use the coxme package to analyse some data I currently
have.
The data is relative to survival times of drosophila melanogaster
populations to infection with pathogens, and has the variables:
Time,
Status,
Treatment (4 treatments + 2 controls)
Population
Replicate
?and I'm currently using the following call
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
2005 Jan 12
2
mydataframe$colname: using substring of colname may also match some column (PR#7496)
Full_Name: Marc Mamin
Version: 1.8, 2.0.0
OS: Windows & Linux
Submission from: (NULL) (217.17.202.254)
Using only the beginning of a column name will match it:
>aaa<-1
>df<-as.data.frame(aaa)
>names(df)
[1] "aaa"
>df$a
[1] 1 !!!!!!!!! (I expect df$a to be undefind)
>df$x
>NULL
Compare with:
> df["aaa"]
aaa
1 1
> df["a"]
2015 Nov 06
0
Puzzled by eval
On 06/11/2015 7:36 AM, Therneau, Terry M., Ph.D. wrote:
> I am currently puzzled by a seach path behavior. I have a library of a dozen routines
> getlabs(), getssn(), getecg(), ... that interface to local repositories and pull back
> patient information. All have a the first 6 arguments in common, and immediately call a
> second routine to do initial processing of these 6. The
2004 Sep 09
2
Rd syntax error detected in CRAN daily checks
Please forgive me if you already received this. I had an e-mail sending
glitch this morning.
http://cran.r-project.org/src/contrib/checkSummary.html reported an
error in Design.trans.Rd
* checking Rd files ... ERROR
Rd files with syntax errors:
/var/mnt/hda3/R.check/r-devel/PKGS/Design/man/Design.trans.Rd:
unterminated section 'alias'
The .Rd file is attached. It begins
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
2005 Sep 09
0
strata in crr (cmprsk library)
Hi all, I am aware that crr lacks the "friendly" command structure of
functions such as cph. All is clear to me about including covariates
until I want to include a stratification term in the competing risk
framework (no nice strat command).
I am still a bit of a novice in R - I am looking for an example to help
me with this, but can't seem to find one. Any advice appreciated (no
2011 Feb 21
2
Interpreting the example given by Prof Frank Harrell in {Design} validate.cph
Dear R-help,
I am having a problem with the interpretation of result from validate.cph in
the Design package.
My purpose is to fit a cox model and validate the Somer's Dxy. I used the
hypothetical data given in the help manual with modification to the cox
model fit. My research problem is very similar to this example.
This is the model without stratification:
> library(Design)
> f1
2015 Nov 06
4
Puzzled by eval
I am currently puzzled by a seach path behavior. I have a library of a dozen routines
getlabs(), getssn(), getecg(), ... that interface to local repositories and pull back
patient information. All have a the first 6 arguments in common, and immediately call a
second routine to do initial processing of these 6. The functions "joe" and "fred" below
capture the relevant
2004 Sep 22
1
Cox proportional hazards model
Good afternoon,
I am currently trying to do some work on survival analysis.
- I hope to seek your advice re: 2 questions (1 general and 1 specific)
(1) I'm trying to do a stratified Cox analysis and subsequently
plot(survfit(object)). It seems to work for some strata, but not for
others.
I have tumor grade, which is a range of 1 - 4.
When I divide this range of 1:4 into 2 groups, it
2010 Mar 18
0
package JM -- version 0.6-0
Dear R-users,
I'd like to announce the release of the new version of package JM (soon
available from CRAN) for the joint modelling of longitudinal and
time-to-event data using shared parameter models. These models are
applicable in mainly two settings. First, when focus is in the
time-to-event outcome and we wish to account for the effect of a
time-dependent covariate measured with
2010 Mar 18
0
package JM -- version 0.6-0
Dear R-users,
I'd like to announce the release of the new version of package JM (soon
available from CRAN) for the joint modelling of longitudinal and
time-to-event data using shared parameter models. These models are
applicable in mainly two settings. First, when focus is in the
time-to-event outcome and we wish to account for the effect of a
time-dependent covariate measured with
2010 Jun 03
1
problem with 'svyby' function from SURVEY package
Hello,
I'm using a complex survey dataset and my goal is to simply spit out a bunch of probability-weighted outcome variable means for the different levels of covariate. So I first define the structure of the study design (I'm using the CDC's NHANES data):
dhanes <- svydesign(id=~PSU, strat=~STRATA, weight=~lab_weight, data=final, nest=TRUE)
No problem there.
Now I use the
2006 Jun 18
1
Post Stratification
Dear WizaRds,
having met some of you in person in Vienna, I think even more fondly
of this community and hope to continue on this route. It was great
talking with you and learning from you. Thank you. I am trying to work
through an artificial example in post stratification. This is my dataset:
library(survey)
age <- data.frame(id=1:8, stratum=rep(
2017 Oct 19
2
Select part of character row name in a data frame
Dear R contributors,
I have a problem in selecting in an efficient way, rows of a data frame according to a condition,
which is a part of a row name of the table.
The data frame is made of 64 rows and 2 columns, but the row names are very long but I need to select them according to a small part of it and perform calculations on the subsets.
This is the example:
X Y
"Unique to