Displaying 20 results from an estimated 3000 matches similar to: "where & how"
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
>
2015 Jun 15
2
Different behavior of model.matrix between R 3.2 and R3.1.1
Terry - your example didn't demonstrate the problem because the variable
that interacted with strata (zed) was not a factor variable.
But I had stated the problem incorrectly. It's not that there are too
many strata terms; there are too many non-strata terms when the variable
interacting with the stratification factor is a factor variable. Here
is a simple example, where I have
2015 Jun 15
2
Different behavior of model.matrix between R 3.2 and R3.1.1
Terry - your example didn't demonstrate the problem because the variable
that interacted with strata (zed) was not a factor variable.
But I had stated the problem incorrectly. It's not that there are too
many strata terms; there are too many non-strata terms when the variable
interacting with the stratification factor is a factor variable. Here
is a simple example, where I have
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
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
2017 Oct 19
0
Select part of character row name in a data frame
(Re-)read the discussion of indexing (both `[` and `[[`) and be sure to get clear on the difference between matrices and data frames in the Introduction to R document that comes with R. There are many ways to create numeric vectors, character vectors, and logical vectors that can then be used as indexes, including the straightforward way:
df[ c(
"Unique to strat ",
"Unique
2010 Apr 29
2
Rotating Titles
Hi All,
I am looking for help in rotating species titles produced using the
strat.plot( ) function in the rioja package. This function produces a
stratigraphic plot of paleoenvironmental data. Currently the titles of each
species are plotted vertically while they are typically plotted at a 45
degree angle in other programs. Does anyone have any idea of how to rotates
these titles?
Below is an
2011 Mar 10
2
using lapply
I have a function with the follow signare:
apply.strategy(instr, strat)
where instr and strat are both objects of classes instrument and strategy
respectively.
I want to apply this function to a list that holds objects of the class
instrument.
Currently I am doing this by explicit looping:
for(i in length(instr.list) ) {
apply.strategy(instr.list[[i]], my.strat)
}
Is it possible to
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")
2017 Oct 19
2
Select part of character row name in a data frame
Thanks a lot, so simple so efficient!
I will study more the grep command I did not know.
Thanks!
Francesca Pancotto
> Il giorno 19 ott 2017, alle ore 12:12, Enrico Schumann <es at enricoschumann.net> ha scritto:
>
> df[grep("strat", row.names(df)), ]
[[alternative HTML version deleted]]
2017 Oct 19
0
Select part of character row name in a data frame
Quoting Francesca PANCOTTO <f.pancotto at unimore.it>:
> 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
2012 Apr 10
6
trust relationship between this workstation and the primary domain failed
Samba shares work for windows 7 and Server 2008, but XP and Server 2000 recieve the following error when trying to map samba shares:
"The trust relationship between this workstation and the primary domain failed."
tail -f /var/log/messages
Apr 10 07:38:03 samba01 smbd[23581]:?? connect_to_domain_password_server: unable to open the domain client session to machine ad1.strat.com. Error
2013 Nov 13
2
determinacion del tamaño de la muestra
Yo no conozco ningún paquete para hacer esto aunque probablemente exista.
De todas maneras las cuentas de este tipo de calculos no suelen ser
complicadas. Personalmente le recomendaría pasarse por una biblioteca y
adquirir el siguiente libro donde explica con todo lujo de detalles, en
castellano y simpliciddad como hacer estos calculos
2007 May 04
3
Error in if (!length(fname) || !any(fname == zname)) { :
Dear R users,
I tried to fit a cox proportional hazard model to get estimation of stratified survival probability. my R code is as follows:
cph(Surv(time.sur, status.sur)~ strat(colon[,13])+colon[,18] +colon[,20]+colon[,9], surv=TRUE)
Error in if (!length(fname) || !any(fname == zname)) { :
missing value where TRUE/FALSE needed
Here colon[,13] is the one that I want to stratify and the
2010 May 05
1
Error messages with psm and not cph in Hmisc
While
sm4.6ll<-fit.mult.impute(Surv(agesi, si)~partner+ in.love+ pubty+ FPA+
strat(gender),fitter = cph, xtrans = dated.sexrisk2.i, data =
dated.sexrisk2, x=T,y=T,surv=T, time.inc=16)
runs perfectly using Hmisc, Design and mice under R11 run via Sciviews-K,
with
library(Design)
library(mice)
ds2d<-datadist(dated.sexrisk2)
options(datadist="ds2d")
2011 Mar 16
2
calculating AUCs for each of the 1000 boot strap samples
Hallo,
I modified a code given by Andrija, a contributor in the list to achieve two objectives:
create 1000 samples from a list of 207 samples with each of the samples cointaining 20 good and 20 bad. THis i have achievedcalcuate AUC each of the 1000 samples, this i get an error.
Please see the code below and assist me.
> data<-data.frame(id=1:(165+42),main_samp$SCORE,
2011 Aug 19
1
adding text to a plot created with strat.plot() from package rioja
I have a plot created with strat.plot() from package rioja. When
the plot is created with scale.percent=FALSE, each x axes is labeled at
0 and its maximum. However, when scale.percent=TRUE, the x axes are not
labeled. I need to use scale.percent=TRUE and I need labels for the x axes.
I have been able to add labels to the x axes with mtext but it is
very tedious to find the correct
2012 Jun 19
1
help with xy.coords(x,y)
i am working on the project to analyze hedge fund performance, i would
appreciate that if you guys could spare some time helping me out with the R
code. Thanks.
The senario is:
i applied BOXPLOT() to plot the performance of all hedge funds with 7
strategies.
And right now in this boxplot I need to plot the points of 30 individual
hedge funds from my portfolio. And I applied POINTS() and
2012 Jan 15
1
problem with table.CAPM in PerformanceAnalytics
All,
I'm attempting to run this:
table.CAPM(series[,"Strat.Return",drop=FALSE],series[,"spy.Return",drop=FALSE])
and getting this error
Error in as.vector(data[, i]) : subscript out of bounds
I've searched around and cannot find a solution to the problem. I've used this in the past without problem and I'm not sure what I did different this time.
Other