coefficient shown in the output by 1 for a sex=1? It used to be (1-.428)*coef.
Thanks for clarifying.
SB
From: Therneau, Terry M., Ph.D.
Sent: Friday, 3 September, 2021 12:37
To: Bond, Stephen
Cc: R-help
Subject: Re: coxph means not equal to means of model matrix
[EXTERNAL
Hi,
Please, help me understand what is happening with the means of a Cox model?
I have:
R version 4.0.2 (2020-06-22) -- "Taking Off Again"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
getOption("contrasts")
unordered ord
, March 22, 2018 10:40 AM
To: Bond, Stephen
Cc: r-help
Subject: Re: [R] how to add a child to a child in XML
Hi,
It's a reasonable question. The answer is that it actually is included, but
there are many instances across packages where multiple functions are
documented on a single help page.
Big thanks. newXMLNode works great. Wonder why it is not included in the
documentation.
There is newXMLDoc and newXMLNamespace, but no mention of newXMLNode.
Stephen
From: Ben Tupper [mailto:btup...@bigelow.org]
Sent: Wednesday, March 21, 2018 6:18 PM
To: Bond, Stephen
Cc: r-help
Subject: Re
I am trying to add a child to a child using XML package in R. the following
fails
library(XML)
node1 <- c("val1","val2","val3")
names(node1) <- c("att1","att2","att3")
root <- xmlNode("root", attrs=node1)
node2 <- LETTERS[1:3]
names(node2) <- paste("name",1:3,sep="")
root <- addChildren(roo
Knowledgeable useRs,
Please, advise how to use offset with a factor. I estimate monthly effects from
a much bigger data set as monthly effects seem to be stable, and other
variables are estimated from a small, but recent data set as there is variation
in those non-seasonal coefficients.
How can
Thanks Caitlin and Richard MH. Works great.
Stephen
From: Caitlin [mailto:bioprogram...@gmail.com]
Sent: Friday, November 10, 2017 12:33 PM
To: Bond, Stephen
Subject: Re: [R] update R version in windows
install.packages("installr")
updateR()
rather...
On Friday, November 10,
This issue does not exist on Linux. My Ubuntu updates both R and all packages.
Stephen B
-Original Message-
From: J C Nash [mailto:profjcn...@gmail.com]
Sent: Friday, November 10, 2017 1:19 PM
To: r-help; RICHARD M. HEIBERGER; Bond, Stephen
Subject: Re: [R] update R version in windows
Is there a utility which will allow me to upgrade my R version and update all
packages from the old version?
If I manually upgrade, then I have to manually re-install 50 packages.
Thank you.
Stephen B
[[alternative HTML version deleted]]
__
R
Hi useRs,
I am running a foreach loop and hoped to get a small message when it hits a
multiple of 1000, but it does not work.
p <- foreach(i=1:1, .combine='c') %dopar% {
if(i%%1000==0) print(i)
sqrt(i)
}
What is the proper way to do it.
Thanks everybo
Does anybody know what are the attributes of a glm fit object that will allow
the "predict call" to produce an se.fit?
I am deleting most of the attributes as the size of the final object is 5Gb and
I want to reduce it to under 20Mb, but that causes as error when I ask for an
se.fit .
mod.b$fi
, October 08, 2014 12:30 PM
To: Duncan Mackay
Cc: R; Bond, Stephen
Subject: Re: [R] lattice add a fit
On Oct 7, 2014, at 9:15 PM, Duncan Mackay wrote:
I'm a tad puzzled by the comments about needing to build a panel function for
locfit. The various plot.locfit functions are actually lattice
-Original Message-
From: Bert Gunter [mailto:gunter.ber...@gene.com]
Sent: Tuesday, October 07, 2014 9:30 AM
To: Bond, Stephen
Cc: r-help@R-project.org
Subject: Re: [R] lattice add a fit
Fit your model in the panel function using lm and plot the fits using
?panel.points, ?panel.lines
What is the way to add an arbitrary fit from a model to a lattice conditioning
plot ?
For example
xyplot(v1 ~v2 | v3,data=mydata,
panel=function(...){
panel.xyplot(...)
panel.loess(...,col.line="red")
}
)
Will add a loess smoother. Instead, I want to put a
Hadley,
You are a genius.
Stephen B
-Original Message-
From: Hadley Wickham [mailto:h.wick...@gmail.com]
Sent: Thursday, June 12, 2014 5:18 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] Rscript fails where Rterm works
Explicitly load the methods package: library
I have a script which loads
library(XLConnect)
wb <- loadWorkbook("wbname")
the code works without errors when run from ESS which uses
R version 3.0.1 (2013-05-16) -- "Good Sport"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)
But fails whe
R version 3.1.0 (2014-04-10) -- "Spring Dance"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)
> library(rJava)
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: dirname(this$RuntimeLib)
error: a character vector argum
hould be able to use
reshape(a1,dir="long",varying=2:11,idvar="x1",v.names="x")
to get it back in long form.
Thank everybody.
Stephen B
-Original Message-
From: MacQueen, Don [mailto:macque...@llnl.gov]
Sent: Wednesday, September 11, 2013 10:42 AM
To: Bond,
Is there a package or a command that does window aggregation like
select
sum(col1) over
(partition by col2, col3 order by col4
rows between unbounded preceding and current row) as sum1
from table1 ;
the above is Netezza syntax, but Postgre has same capability.
Stephen B
[[alternative HT
Hello useRs,
Having trouble getting odfWeave to work here. Crashing at unzipping like noted
in many other posts. The unzip utility referred in the doc no longer exists
(page last updated in 2004 and links are not found.)
If anybody knows how to make it work on XP pls advise. I can manually unzi
Please, help with a formula for dealing with unbalanced design:
To see the counts:
aggregate(dfa$CertId,by=list(type=dfa$ComType,stat=dfa$StatusCodeId),length)
type stat x
1C1 6571
2C3 28957
3C8 12390
4C 11 12415
5E 13 9
6R 1351
7E 15
8
3623963 2012-11-24 00:00:00 19598.56847130979
3623963 2012-11-25 00:00:00 56094.581213680210
3623963 2012-11-26 00:00:00 25690.439183149 11
3623963 2012-11-27 00:00:00 25420.9915256714 12
3623963 2012-11-28 00:00:00 30322.375086543413
3623963 20
Dear useRs,
What is the syntax to obtain survival curves for single strata on many subjects?
I have a model based on Surv(time,response) object, so there is a single row
per subject and no start,stop and no switching of strata.
The newdata has many subjects and each subject has a strata and the
I also tried fitting a spline to the resulting survival curve and the result
was horrible.
maybe spline won't work or knots need special handling.
overall, I must have the final point of the smooth survival to be same as the
final point of the raw Cox survival and no flat days, the drops sho
Hello users,
I would like to obtain a survival curve from a Cox model that is smooth and
does not have zero differences due to no events for those particular days.
I have:
> sum((diff(surv))==0)
[1] 18
So you can see 18 days where the survival curve did not drop due to no events.
Is there a wa
...@statistik.tu-dortmund.de]
Sent: Friday, December 21, 2012 1:01 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] Rterm does not load personal library
On 21.12.2012 18:16, Bond, Stephen wrote:
> Greetings,
>
> I am trying to run a short script from a shell:
>
> c
on halted
Stephen
-Original Message-
From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de]
Sent: Friday, December 21, 2012 1:01 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] Rterm does not load personal library
On 21.12.2012 18:16, Bond, Stephen wrote:
> Greetings,
Greetings,
I am trying to run a short script from a shell:
c:\projects\hell>Rscript --default-packages=mypack X:/4Stephen/commit/curve.R >
X:/4Stephen/commit/run1.out
Loading required package: utils
Warning message:
package 'RODBC' was built under R version 2.12.2
Error: could not find functio
I have used the errata from there, but have not found where to download working
R code from.
Stephen
-Original Message-
From: Sarah Goslee [mailto:sarah.gos...@gmail.com]
Sent: Monday, December 17, 2012 4:22 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] rms R code
Greetings, useRs.
Does anybody have replication of the examples from the RMS book by Harrell
coded in R? I find that most the code does not work and it takes too much time
to debug.
For example from p.276
> age.t <- w[,"age"]
> f.full <-
> lrm(cvd~scored(rx)+rcs(dtime,5)+age.t+wt.t+pf.t+hx+sbp
Is this a bug:
Trying to update when the where condition gives zero rows throws an error on MS
SQL server
> sqlQuery(pipe,"select * from ComDetailCurrent where RateTypeId is null;")
[1] ProcessDate SourceSystemIdAccountNumber Xref1
<0 rows> (or 0-length row.names)
sq
: David Winsemius [mailto:dwinsem...@comcast.net]
Sent: Monday, October 01, 2012 12:53 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] Hmisc describe error
On Oct 1, 2012, at 9:33 AM, Bond, Stephen wrote:
> Describe fails for me with a message similar to what was an issue in 2008
Describe fails for me with a message similar to what was an issue in 2008 and
got fixed according to posts.
R version 2.15.0 (2012-03-30)
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-pc-mingw32/i386 (32-bit)
# output truncated
> options(chmhelp
ckages, so the few bad apples are
properly labelled and can be avoided by the community.
Kind regards
Stephen B
-Original Message-
From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de]
Sent: Wednesday, May 30, 2012 4:23 AM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R
this works:
bigcl <- read.table(file="bigCL1.csv",sep=',',header=T ,
colClasses=c(rep("factor",3),"numeric","NULL","integer",
"numeric","integer","NULL","numeric","NULL"),nrow=1000)
this doesn't:
bigcl <- read.table.ffdf(file="bigCL1.csv",sep=',',header=T ,
]
Sent: Friday, March 30, 2012 7:32 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] ff usage for glm
On Sat, Mar 31, 2012 at 9:05 AM, Bond, Stephen wrote:
> Greetings useRs,
>
> Can anyone provide an example how to use ff to feed a very large data frame
> to glm?
> The da
Greetings useRs,
Can anyone provide an example how to use ff to feed a very large data frame to
glm?
The data.frame cannot be loaded in R using conventional read.csv as it is too
big.
glm(...,data=ff.file) ??
Thank you
Stephen B
__
R-help@r-project.
Greetings UseRs,
Pls advise if there is a way to write a func that can be supplied to aggregate
to compute weighted MeanAbsolute Dev (MAD). I am having trouble passing the
correct weights from each group level and cannot see the code behind aggregate.
But maybe 'aggregate' is not the best way t
I am attemting to use glmD in order to use latex(obj) afterwards.
Glm works fine, glmD throws an error:
> conv.go <-
> glmD(cbind(go.cnt,tot.cnt-go.cnt)~sn+rcs(relAge,4)+termfac+rate:termfac+
+
I(relAge*term>(term-1.25))+I((prevbal/tot.cnt)*1e-4)+prod+newmort+
+
Greetings useRs,
What is the easiest way to create a design matrix of several factor variables?
Function gendata in Design seems to do that for a fitted model, but how to do
that only on several factor vectors??
The result should be a df with one row for each distinct combination of levels
of
Ligges [mailto:lig...@statistik.tu-dortmund.de]
Sent: Thursday, October 06, 2011 9:12 AM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] how to install a locally built package
On 06.10.2011 15:10, Bond, Stephen wrote:
> Is there a way to put all R code in a single file?
>
> I
code in one file only the first func is loaded.
Thanks everybody
Stephen B
-Original Message-
From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de]
Sent: Friday, September 16, 2011 3:43 AM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] how to install a locally built
o:lig...@statistik.tu-dortmund.de]
Sent: Thursday, September 15, 2011 12:15 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] how to install a locally built package
On 15.09.2011 17:47, Bond, Stephen wrote:
> Uwe,
>
> That gave me the same error like CMD install
>> insta
for private use only and there is
no help or data files.
Thank you.
Stephen Bond
-Original Message-----
From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de]
Sent: Thursday, September 15, 2011 11:43 AM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] how to install a locally buil
Hello useRs,
I am trying to put my funcs in a package to avoid clutter in my workspace as
the funcs are now in .Rprofile.
All plain R code no compilations. Using win XP with a full cygwin install and
R2.12
I first did
package.skeleton("mypack",list="getdfv", namespace=T) # just a single func
w
the way a glm model can be used.
Thanks everybody.
Stephen
-Original Message-
From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de]
Sent: Thursday, August 11, 2011 11:40 AM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] model formula
On 11.08.2011 17:27, Bond, Stephen
Hello useRs,
Pls help with removing a single interaction term from a formula:
summary(
glm.turn.2 <-
glm(cbind(turn.cnt,tot.cnt-turn.cnt)~sn+poly(relAge,2,raw=T)+termfac+rate:termfac,data=fix,
family="quasibinomial")
)
Gives
Coefficients:
newdata = inc[50050:50100, ], type = "expected") :
Method not yet finished
Stephen
-Original Message-
From: Terry Therneau [mailto:thern...@mayo.edu]
Sent: Friday, February 04, 2011 8:54 AM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: coxph fails to survfit
>
ching time dependent risk to the proper time index of the
survival curve.
Thanks David.
Stephen
-Original Message-
From: David Winsemius [mailto:dwinsem...@comcast.net]
Sent: Thursday, February 03, 2011 3:10 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] coxph fails t
I have a model with quant vars only and the error message does not make sense:
(mod1 <- coxph(Surv(time=strt,time2=stp,event=(resp==1))~
+incpost+I(amt/1e5)+rate+strata(termfac),
subset=dt<"2010-08-30", data=inc,method="efron"))
Call:
coxph(formula = Surv(time = strt, time2 = stp,
The following fit does not make sense to me, please, correct me if I have a
logical error.
> moddowsn
Call:
coxph(formula = Surv(start, stop, resp) ~ sn + matfac2, data = coxsn1,
method = "efron")
coef exp(coef) se(coef) z p
sn2 0.0497 1.051 0.02030 2.45
made smart and subsequent calls on the same model will use the
first call to survfit?? It's your call :-)
Kind regards
Stephen B
-Original Message-
From: Terry Therneau [mailto:thern...@mayo.edu]
Sent: Thursday, October 28, 2010 6:39 PM
To: Bond, Stephen; David Winsemius
Cc:
comcast.net]
Sent: Wednesday, October 27, 2010 1:15 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] coxph linear.predictors
On Oct 27, 2010, at 12:12 PM, Bond, Stephen wrote:
> I would like to be able to construct hazard rates (or unconditional
> death prob)
Hazards are
sem...@comcast.net]
Sent: Wednesday, October 27, 2010 1:15 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] coxph linear.predictors
On Oct 27, 2010, at 12:12 PM, Bond, Stephen wrote:
> I would like to be able to construct hazard rates (or unconditional
> death prob)
Hazard
riety of formulas, so I guess this is the spirit of SAS
disguising itself as an R package.
Stephen Bond
-Original Message-
From: David Winsemius [mailto:dwinsem...@comcast.net]
Sent: Wednesday, October 27, 2010 2:17 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R]
sampled daily this is a day interval.
Your comments are appreciated.
Stephen Bond
-Original Message-
From: David Winsemius [mailto:dwinsem...@comcast.net]
Sent: Wednesday, October 27, 2010 1:15 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] coxph linear.predictors
How can I expose the code behind plot.survfit??
Thanks a lot.
Stephen B
[[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-proje
Is it possible to get survfit to produce the survival line for a single strata
like
preddow <- survfit(modall,newdata=newdat,se.fit=F,strata=2)
# the strata argument is being ignored in the call above
Or even get a more economical/faster calculation of the hazard directly from
the coxph object
om]
Sent: Tuesday, October 12, 2010 4:16 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] aggregate with cumsum
On Tue, Oct 12, 2010 at 1:40 PM, Bond, Stephen wrote:
> Hello everybody,
>
> Data is
> myd <- data.frame(id1=rep(c("a","b","c"),e
Hello everybody,
Data is
myd <- data.frame(id1=rep(c("a","b","c"),each=3),id2=rep(1:3,3),val=rnorm(9))
I want to get a cumulative sum over each of id1. trying aggregate does not work
myd$pcum <- aggregate(myd[,c("val")],list(orig=myd$id1),cumsum)
Please suggest a solution. In real the dataframe
-
From: Frank Harrell [mailto:harre...@gmail.com] On Behalf Of Frank Harrell
Sent: Thursday, September 02, 2010 4:23 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] Comparing COXPH models, one with age as a continuous variable,
one with age as a three-level factor
On Thu, 2 Sep
other suggestion about data.table and report.
Cheers everybody.
Stephen B
-Original Message-
From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com]
Sent: Thursday, August 26, 2010 4:26 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] sqldf syntax
On Thu, Aug 26, 2010 at 2:
Please correct the following
> sqldf("update esc left join forwagg on esc.ym=forwagg.Date set
> esc.ri2=forwagg.N1 where esc.age=12","select * from main.esc")
Error in sqliteExecStatement(con, statement, bind.data) :
RS-DBI driver: (error in statement: near "left": syntax error)
Thanks.
Step
Please, tell what is the best way to create an R glm object with parameters etc
estimated in SAS?
I have a large dataset and bigglm fails to converge, so estimation is done is
SAS. However, there are a lot of predictions that are much more easily done in
R and I would like to use glm.predict an
o:pda...@gmail.com]
Sent: Thursday, July 08, 2010 4:09 AM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] forcing a zero level in contr.sum
Bond, Stephen wrote:
> I need to use contr.sum and observe that some levels are not
> statistically different from the overall mean of zero.
s still there. Unbelievable.
Stephen Bond
-Original Message-
From: David Winsemius [mailto:dwinsem...@comcast.net]
Sent: Wednesday, July 07, 2010 4:15 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] forcing a zero level in contr.sum
On Jul 7, 2010, at 4:04 PM, Bond,
-1 -1 -1 -1
I need to force the coefficient on level 03 to be zero.
Thank you.
Stephen Bond
-Original Message-
From: David Winsemius [mailto:dwinsem...@comcast.net]
Sent: Wednesday, July 07, 2010 3:44 PM
To: Bond, Stephen
Cc: r-help@r-project.org
Subject: Re: [R] forcing a
I need to use contr.sum and observe that some levels are not statistically
different from the overall mean of zero.
What is the proper way of forcing the zero estimate? It seems the column
corresponding to that level should become a column of zeros.
Is there a way to achieve that without me const
Is there a library dealing with correlation in the residuals of a glm?
I have
bin3alt <-glm(respalt~ t+sn+c5.vrm,data=dfalt,family="quasibinomial")
> bin3alt
Call: glm(formula = respalt ~ t + sn + c5.vrm, family = "quasibinomial",
data = dfalt)
Coefficients:
(Intercept) t2
I need to remove certain interactions and keep only the one between the second
level of the factor and the continuous var t2
bin4 <- glm(resp2~ t*t2+c5.vrm,data=dfa,family="quasibinomial")
> summary(bin4)
Call:
glm(formula = resp2 ~ t * t2 + c5.vrm, family = "quasibinomial",
data = dfa)
Dev
I need to change one of the axis produced by persp by giving it labels for the
tickmarks.
The dimension has months (a factor) so the default decimals don't look good.
The graph will finally become a pdf or emf file to be embedded in a document,
so persp3d will not work, I think.
Thank you all.
Clarification:
Lm is much better than the base forecast from lme level=0,
Level=1 produces a much tighter fit than lm.
I was expecting that level=0 would produce something very close to lm, but it
does not.
[[alternative HTML version deleted]]
_
Hello r-help,
I am using lme with two specs for the variance func
varComb(varFixed(~1/n)),varPower(~Age))
this produces worse forecasts than the lm model with simple
weights=n
I think due to the fact that the lme spec works on variance inside the group. I
need to show it that 1/n scales the v
This is not a purely stats question as it depends on the implementation of
mixed models in R.
The help says that ordered factors are treated differently than unordered,
which is not very informative.
More explicitly: does ordering simply imply that February follows January or
that February has
Hello everybody,
Please help with connecting the AIC and BIC numbers printed by summary.gls to
the logLik number.
1. is the logLik number the true ML or density scaling constants have been
omitted?
2. what is the formula for calculating the AIC and BIC from logLik (and how
can I see it)?
Hello everybody,
I have a dataset where each row has number of subjects and that gives me
natural weights for the variance function. Additionally I see that variance
increases with Age, which is a regressor.
So using gls I have
weights=varFixed(~1/n)
but don't know how to include the extra e
76 matches
Mail list logo