[R] Help on read in a txt file

2008-04-25 Thread ssls sddd
Dear list, Hello! I had a problem of reading in a txt file and need your help. The txt file, called A, comprises of 592 columns and 34179 rows. I need to note that for some cells of A , A[i,j], are blank. I used read.table() and got the warning message: A-read.table(file=A.txt,sep=\t) Warning

Re: [R] Use of survreg.distributions

2008-04-25 Thread Abdus Sattar
Dear R-user: I am using survreg(Surv()) for fitting a Tobit model of left-censored longitudinal data. For logarithmic transformation of y data, I am trying use survreg.distributions in the following way: tfit=survreg(Surv(y, y=-5, type=left)~x + cluster(id), dist=gaussian, data=y.data,

[R] request for Unsubscribe

2008-04-25 Thread Amir Kavousi
Dear Please unsubscribe my email from mailing list of R-Help. Thanks Amir Kavousi [EMAIL PROTECTED] - [[elided Yahoo spam]] [[alternative HTML version deleted]] __

Re: [R] Using image function to plot character values

2008-04-25 Thread Dieter Menne
Eric Bell eric at ericjbell.com writes: A secondary problem is that after I do the conversion, I need to know what codes were converted to what numeric values. Column-wise factor conversion can be handy, but often it bites. # Assume you have the data file m1 m2 A B B C C D #---

Re: [R] request for Unsubscribe

2008-04-25 Thread Peter Dalgaard
Amir Kavousi wrote: Dear Please unsubscribe my email from mailing list of R-Help. Please use the unsubscription mechanism at https://stat.ethz.ch/mailman/listinfo/r-help (near the bottom) -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ ---

[R] Constructing dummy variables for months for a time series object

2008-04-25 Thread Megh Dal
I have a TS of monthly observations. head(data4) 1991(1) 1991(2) 1991(3) 1991(4) 1991(5) 1991(6) 12.00864 11.94203 11.98386 12.01900 12.19226 12.15488 Now I want to make 11 dummy variables indicating months. Therefore I did followings : For Jan : rep(c(rep(0,0), 1,

[R] How to overlap two density plots?

2008-04-25 Thread Emre Unal
Hi, How can I overlap two density plots? A - c(8,10,10,11,11,11,12,12,12,12,11,11,11,10,10,7) B - c(11,13,13,14,14,14,15,15,15,15,14,14,14,13,13,10) plot(density(A)) plot(density(B)) Regards, Emre P.S. There's a overlap.density function in package DAAG Is there another way to do

Re: [R] force glm estimates to be nonnegative

2008-04-25 Thread Samu Mäntyniemi
You could use the BRugs package and formulate your prior knowledge about slopes in terms of a probability distribution. Michele Christina Itten kirjoitti: Is there a way to force certain formula parameters to be nonnegative? What I want to do is to estimate student capacity over time,

Re: [R] make check errors with R 2.7.0

2008-04-25 Thread Patrick Connolly
On Fri, 25-Apr-2008 at 06:12AM +0100, Prof Brian Ripley wrote: Note that the problem is not that you got the message, but an apparent whitespace issue in the output. That's clearer in this version: note that the output for reg-IO.Rout.save is shifted left one column. But I don't trust

Re: [R] Constructing dummy variables for months for a time series object

2008-04-25 Thread N. Lapidus
GenDummyVar - function (NumMonth) rep(c(rep(0, NumMonth-1), 1, rep(0, 12-NumMonth)), 17) NameDummy - c(DJan, DFeb, DMar, DApr, DMay, DJun, DJul, DAug, DSep, DOct, DNov, DDec) for (NumMonth in 1:12) assign(NameDummy, GenDummyVar (NumMonth)) DJan [1] 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0

Re: [R] Constructing dummy variables for months for a time series object

2008-04-25 Thread N. Lapidus
Oops.. the last line should have been : for (NumMonth in 1:12) assign(NameDummy[NumMonth], GenDummyVar (NumMonth)) On Fri, Apr 25, 2008 at 10:18 AM, N. Lapidus [EMAIL PROTECTED] wrote: GenDummyVar - function (NumMonth) rep(c(rep(0, NumMonth-1), 1, rep(0, 12-NumMonth)), 17) NameDummy -

Re: [R] request for Unsubscribe

2008-04-25 Thread Knut Krueger
Amir Kavousi schrieb: Dear Please unsubscribe my email from mailing list of R-Help. Thanks Amir Kavousi [EMAIL PROTECTED] you can unsubsribe at the following page by yourself. (including password reminder) https://stat.ethz.ch/mailman/listinfo/r-help

[R] Non-linear system of equations

2008-04-25 Thread Radka Pancheva
Hello R users, I am trying to estimate the parameters of a bimodal normal distribution using moments matching, so I have to solve a non-linear system of equations. How can I solve the following simple example? x^2 - y^2 = 6 x – y = 3 I heard about nlsystemfit, but I don’t know how to run it

Re: [R] Using image function to plot character values

2008-04-25 Thread Jim Lemon
Eric Bell wrote: Hello. I am a newbie to R. If I should be reading some FAQ or manual that could help answer my question please tell me and I will go there. Problem: I have a spreadsheet that contains a character code in each cell. The columns in the spreadsheet represent time and the

[R] grid() : start values?

2008-04-25 Thread Agustin Lobo
Hi, is not there any way to tell grid() the starting value? With nx,ny I get the right number of grid cells, but not on the exact values I would like them. (I know I can do it with abline(), just asking for an easier way, i.e. grid(nx,nx,start.x,start.y)) An alternative way (which would solve

Re: [R] Non-linear system of equations

2008-04-25 Thread Paul Smith
2008/4/25 Radka Pancheva [EMAIL PROTECTED]: I am trying to estimate the parameters of a bimodal normal distribution using moments matching, so I have to solve a non-linear system of equations. How can I solve the following simple example? x^2 - y^2 = 6 x – y = 3 I heard about

Re: [R] How to overlap two density plots?

2008-04-25 Thread David Winsemius
Emre Unal [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Hi, How can I overlap two density plots? A - c(8,10,10,11,11,11,12,12,12,12,11,11,11,10,10,7) B - c(11,13,13,14,14,14,15,15,15,15,14,14,14,13,13,10) plot(density(A)) Instead: lines(density(B)) -- David Winsemius

Re: [R] Non-linear system of equations

2008-04-25 Thread Radka Pancheva
Hello Paul, Thank you for your quick answer. I have tried to use your advice and to estimate the parameters of beta distribution with moments matching. This is my code: ex - 0.3914877 ex2 - 0.2671597 my.mm - function(x){ p - x[1] q - x[2] p - .Machine$double.eps

Re: [R] grid() : start values?

2008-04-25 Thread Duncan Murdoch
On 4/25/2008 5:32 AM, Agustin Lobo wrote: Hi, is not there any way to tell grid() the starting value? With nx,ny I get the right number of grid cells, but not on the exact values I would like them. (I know I can do it with abline(), just asking for an easier way, i.e.

Re: [R] How to overlap two density plots?

2008-04-25 Thread Philipp Pagel
On Fri, Apr 25, 2008 at 10:57:27AM +0300, Emre Unal wrote: How can I overlap two density plots? A - c(8,10,10,11,11,11,12,12,12,12,11,11,11,10,10,7) B - c(11,13,13,14,14,14,15,15,15,15,14,14,14,13,13,10) plot(density(A)) lines(density(B)) cu Philipp -- Dr. Philipp Pagel

[R] No rule to make target 'R/Copy'

2008-04-25 Thread Ardia David
Dear all, I am currently building a package with C code (in scr folder). Everything was ok, but now, I get the following error message when compiling the package using R CMD INSTALL: make[2]: *** No rule to make target 'R/Copy', needed in [...] What does that mean? I can still compile other

Re: [R] Use of survreg.distributions

2008-04-25 Thread Terry Therneau
--begin included message --- I am using survreg(Surv()) for fitting a Tobit model of left-censored longitudinal data. For logarithmic transformation of y data, I am trying use survreg.distributions in the following way: tfit=survreg(Surv(y, y=-5, type=left)~x + cluster(id), dist=gaussian,

Re: [R] Non-linear system of equations

2008-04-25 Thread Berend Hasselman
x^2 - y^2 = 6 x – y = 3 You can also try this # function f - function(x) { y - numeric(2) y[1] - x[1]^2-x[2]^2-6 y[2] - x[1]-x[2]-3 y } # function values transformed to scalar # minimising fnorm this way is not the best method of finding a solution for f(x)=0

Re: [R] Non-linear system of equations

2008-04-25 Thread Paul Smith
Try to change the initial values of the parameters with, for instance, p0 - rnorm(2) But you sure that your system has a solution, Evgeniq? Paul 2008/4/25 Radka Pancheva [EMAIL PROTECTED]: Hello Paul, Thank you for your quick answer. I have tried to use your advice and to estimate the

Re: [R] No rule to make target 'R/Copy'

2008-04-25 Thread Prof Brian Ripley
Do you have a space in some file name? Starting 'Copy '? On Fri, 25 Apr 2008, Ardia David wrote: Dear all, I am currently building a package with C code (in scr folder). Everything was ok, but now, I get the following error message when compiling the package using R CMD INSTALL: make[2]:

Re: [R] R Newbie Question/Data Model

2008-04-25 Thread Rubén Roa-Ureta
[EMAIL PROTECTED] wrote: Given a data set and a set of predictors and a response in the data, we would like to find a model that fits the data set best. Suppose that we do not know what kind of model (linear, polynomial regression,... ) might be good, we are wondering if there is R-package(s)

[R] package compilation: including external libraries in windows compilation

2008-04-25 Thread Jonathan Lees
Dear R package developers: I need help on getting a package compiled for windows. I am trying to use definitions and routines from a set of libraries in that are in LINUX under #include netdb.h #include sys/socket.h #include netinet/in.h #include arpa/inet.h but these are unavailable in windows.

Re: [R] Non-linear system of equations

2008-04-25 Thread Ravi Varadhan
Hi Radka, The problem lies in your function my.mm(). Especially, the following lines: p - .Machine$double.eps q - .Machine$double.eps Even if you take out these 2 lines, still the definition is not correct, I think, since there is a trivial answer x* = c(0, q). I am not sure how you

Re: [R] Non-linear system of equations

2008-04-25 Thread Ravi Varadhan
Radka, Generally, there is no need to increase `maxit' to beyond default. If you are unable to obtain a reasonable approximation to your system within `maxit', then you should do the following (not necessarily in that order): 1. Try a few different starting values and see if you can obtain a

[R] Extracting coefficients' standard errors from linear model

2008-04-25 Thread Uli Kleinwechter
Dear all, Hope this question is not too trivial... In order to correct standard errors from an estimation of a fixed effects regression model y need to extract the vector of standard errors of the coefficients of a simple linear model estimated using lm(var1~var2+var3+var4) Unfortunately I

[R] remarks on function pnbeta

2008-04-25 Thread Ali Baharev
Dear Developers, The pnbeta function has been reviewed recently in the article of A. Baharev, S. Kemény, On the computation of the noncentral F and noncentral beta distribution, Statistics and Computing, 2008, in press. Preprint of the paper is available here:

Re: [R] package compilation: including external libraries in windows compilation

2008-04-25 Thread Prof Brian Ripley
The standard C define is WIN32, not Win32 (which R uses as private define). You could have PKG_CPPFLAGS=-DWin32 in Makevars.win, but this is unnecessary. See e.g. Rmath.h. On Fri, 25 Apr 2008, Jonathan Lees wrote: Dear R package developers: I need help on getting a package compiled for

Re: [R] Extracting coefficients' standard errors from linear model

2008-04-25 Thread David Winsemius
Uli Kleinwechter [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Dear all, Hope this question is not too trivial... In order to correct standard errors from an estimation of a fixed effects regression model y need to extract the vector of standard errors of the coefficients of a

Re: [R] Documentation General Comments

2008-04-25 Thread Tubin
I realize the R developers are probably overwhelmed and have little time for this, but the documentation really needs some serious reorganizaton. My reply: I'm quite new to R and so have spent a lot of time in the last few days reading documentation both online and text. I'm incredibly

[R] join chars in loops

2008-04-25 Thread Dirkheld
Hi, Is it possible to create new vars in a loop For instance: for (i in 1:11) var'i' - assign something output = var1 var2 ... var11 Is there a way to combine/join the value of 'i' to the string/char var in de loop. -- View this message in context:

Re: [R] join chars in loops

2008-04-25 Thread jim holtman
for (i in 1:11){ assign(paste('var', i, sep=''), value) } On Fri, Apr 25, 2008 at 10:40 AM, Dirkheld [EMAIL PROTECTED] wrote: Hi, Is it possible to create new vars in a loop For instance: for (i in 1:11) var'i' - assign something output = var1 var2 ... var11 Is there a way to

Re: [R] Extracting coefficients' standard errors from linear model

2008-04-25 Thread Henrique Dallazuanna
Try: summary(lm.D9)[[coefficients]][,2] On Fri, Apr 25, 2008 at 10:55 AM, Uli Kleinwechter [EMAIL PROTECTED] wrote: Dear all, Hope this question is not too trivial... In order to correct standard errors from an estimation of a fixed effects regression model y need to extract the vector

Re: [R] join chars in loops

2008-04-25 Thread Dimitris Rizopoulos
look at ?assign(), e.g., for (i in 1:11) { assign(paste(var, i, sep = ), i) } var1 var2 var10 but I'd prefer to use a list. I hope it helps. Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35,

Re: [R] matrix from list

2008-04-25 Thread Greg Snow
You may want to read the help page for '[' and '[[' a few more times (the differencese can be subtle). The '[[' only returns a single element from a data structure (but in the case of a list, that single element can be quite complex). So something like list[[1:2]] does not make sense because you

Re: [R] No rule to make target 'R/Copy'

2008-04-25 Thread Ardia David
No... don't think so. I rerun my computer, moved some folders (I deleted the folder with .C file), rerun the compilation, and it worked... Not sure to understand why. Any idea? Prof Brian Ripley wrote: Do you have a space in some file name? Starting 'Copy '? On Fri, 25 Apr 2008, Ardia

Re: [R] Extracting coefficients' standard errors from linear model

2008-04-25 Thread Marc Schwartz
Or use: mod - lm(var1 ~ var2 + var3 + var4) coef(summary(mod))[, 2] or coef(summary(lm.D9))[, Std. Error] if you prefer using column names. coef() extracts the model coefficients from the lm object and the additional content in a summary.lm object. There are accessor functions for

Re: [R] Sum of random values

2008-04-25 Thread Greg Snow
You might want to look at the distr package (and its relatives). It provides methods for calculating the distribution function of combinations (the sum is one) of other distributions. I'm not sure how you would convert your percentiles to a distribution function, but there may be a way in the

Re: [R] join chars in loops

2008-04-25 Thread Bert Gunter
... That is, use the construction thelist - lapply(1:11,function(i){...return something}) I would go further then Dmitris and say that this should be the canonical answer to this frequently asked question and that perhaps in 7.21 in the R FAQ (Version 2.6.2 -- I haven't yet upgraded) -- How can

[R] fix variance parameter values for lmer estimation

2008-04-25 Thread Wilfried Cools
Dear list-members, a model is fit with lmer, but I want to force the variance parameter values to be as defined by me I thought, use 'start' to specify initial values and only allow for one iteration ? my question is how to do that ? to specify the 2x2 matrix of variance parameter values:

[R] FASeg

2008-04-25 Thread Vidhu Choudhary
Hi All, I was using FASeg package. Now when I am trying to install this library I get the message Warning message: package 'FASeg' is not available Can someone please suggest something. Thank you vidhu [[alternative HTML version deleted]] __

[R] Rows assignment

2008-04-25 Thread Yuri Volchik
Hi to all members, i encountered a weird problem when trying to assign subset of rows in a matrix. Simple example works fine: z-matrix(NA,ncol=3,nrow=10) z[,1]-1:10 y-matrix(1:30,ncol=3,nrow=10) y[,1]-5:14 z[z[,1]%in%y[,1],2]-y[y[,1]%in%z[,1],2] z z[z[,1]%in%y[,1],]-y[y[,1]%in%z[,1],] z When i

Re: [R] fix variance parameter values for lmer estimation

2008-04-25 Thread Douglas Bates
On 4/25/08, Wilfried Cools [EMAIL PROTECTED] wrote: Dear list-members, a model is fit with lmer, but I want to force the variance parameter values to be as defined by me I thought, use 'start' to specify initial values and only allow for one iteration ? my question is how to do that ?

Re: [R] Use of survreg.distributions

2008-04-25 Thread Abdus Sattar
Hello Dr. Therneau:   Thank you for your response. Let me explain to you want I want. My y variable(time) is normal and would like to fit the model on logarithmic transformation of y (log(y)). I tried to run codes according to your suggestion: tfit=survreg(Surv(y, y=-5, type=left)~x +

[R] making a dll for windows eviornment for R

2008-04-25 Thread Vidhu Choudhary
Hi All, I have a .c file and I need to make a dll so that it could be called by R. I have successfully made .so from .c file and its working great. But i have no clue of making dll. I tried googling for help ...but not much of use Please suggest something regards Vidhu [[alternative

Re: [R] Documentation General Comments

2008-04-25 Thread Spinu Vitalie
Each pdf reference manual includes an index of functions classified according to keywords. I wonder why indexes in on-line documentation do not include similar categorisation. It would be much easier to figure out all related functions and topics. Thanks, Vitalie.

Re: [R] making a dll for windows eviornment for R

2008-04-25 Thread Duncan Murdoch
On 4/25/2008 1:12 PM, Vidhu Choudhary wrote: Hi All, I have a .c file and I need to make a dll so that it could be called by R. I have successfully made .so from .c file and its working great. But i have no clue of making dll. I tried googling for help ...but not much of use Please suggest

Re: [R] Obtaining correlation parameters for multiple rows

2008-04-25 Thread jpnitya
Hi Jorge, That was great! Thank you very much for the suggestion. I just had to make a couple of minor changes (e.g., pearson vs. spearman) and it worked perfectly. Thanks, Joao Pedro Hi, I'm sure it could be better but try this: # F statistics based on lm FSTAT=function(y,x)

Re: [R] Differentiate alphanumeric vs numeric strings

2008-04-25 Thread Farrel Buchinsky
This is fantastic. As a future note to myself and to others who may stumble upon this: further documentation for all one's heart could desire is in the base help system at. Regular Expressions as used in R - regexp Pattern Matching and Replacement - grep Split the Elements of a Character Vector

[R] hist densities

2008-04-25 Thread Sarah Hardy
This is a reply to Luke Spadavecchia's question about hist densities. If you want to construct a histogram where the bar heights are the percentage of observations in the intervals you can use this code: x-rnorm(n=5000,mean=1.5,sd=0.25) h-hist(x) h$density-h$counts/sum(h$counts)

Re: [R] Constructing dummy variables for months for a time series object

2008-04-25 Thread Bill.Venables
The simplest way is probably to generate them as the columns of a matrix. Let's suppose you have data from Jan 1991 up to Mar 2008. X - outer(rep(month.abb, length = 16*12+3), month.abb, ==) + 0 ## the + 0 will convert logical to numeric dim(X) [1] 195 12 dimnames(X)[[2]] - month.abb

[R] Equivalent of Excel pivot tables in R

2008-04-25 Thread ppaarrkk
Can somebody tell me how to do the equivalent of a pivot table in R ? For example, if I have : var1var2 var3 a x10 b y20 a z10 b z20 a z10 b z20 I could have : x y z a

Re: [R] Equivalent of Excel pivot tables in R

2008-04-25 Thread Jorge Ivan Velez
Hi, Try this: x=var1var2 var3 a x10 b y20 a z10 b z20 a z10 b z20 yourdata=read.table(textConnection(x),header=TRUE) attach(yourdata) res=tapply(var3,yourdata[,-3],sum) # With tapply!

Re: [R] Equivalent of Excel pivot tables in R

2008-04-25 Thread Jim Porzak
See Hadley's reshape package http://had.co.nz/reshape/ and on CRAN. On Fri, Apr 25, 2008 at 2:54 PM, ppaarrkk [EMAIL PROTECTED] wrote: Can somebody tell me how to do the equivalent of a pivot table in R ? For example, if I have : var1var2 var3 a x10 b y

Re: [R] Equivalent of Excel pivot tables in R

2008-04-25 Thread Henrique Dallazuanna
Try: with(x, tapply(var3, list(var1, var2), length)) with(x, tapply(var3, list(var1, var2), sum)) Or with xtabs xtabs(as.logical(var3) ~ var1 + var2, data = x) xtabs(var3 ~ var1 + var2, data = x) On 4/25/08, ppaarrkk [EMAIL PROTECTED] wrote: Can somebody tell me how to do the

Re: [R] matrix from list

2008-04-25 Thread Olivier Lefevre
Greg Snow wrote: The '[[' only returns a single element from a data structure I know but that is precisely what I find arbitrary. Anyway you are right that it would still return the kind of object, only subsetted, which is not I want. As someone kindly pointed out to me offline, besides the

[R] Ubuntu vs Mac OS X

2008-04-25 Thread Guillaume Blanchet
Hi ! I have installed R-2.7.0 64-bits on a computer where the new Ubuntu version (8.04) was installed. This computer is a 3.2 GHz Dual-core with 2 Gb of RAM. To test how fast (I though !) this machine is, I compared two simple matrix manipulations between Ubuntu and my laptop (a MacBook Pro

Re: [R] Equivalent of Excel pivot tables in R

2008-04-25 Thread Jorge Ivan Velez
Hi, I forgot the first part (I'm sorry): table(var1,var2) var2 var1 x y z a 1 0 2 b 0 1 2 HTH, Jorge On Fri, Apr 25, 2008 at 7:25 PM, Jorge Ivan Velez [EMAIL PROTECTED] wrote: Hi, Try this: x=var1var2 var3 a x10 b y20 a z

Re: [R] Constructing dummy variables for months for a time series object

2008-04-25 Thread Gabor Grothendieck
First generate a factor and then calculate its model matrix: month. - factor(cycle(x), labels = month.abb) model.matrix(~ month.)[,-1] Actually you may not even need the dummy variables at all if your purpose is to do a regression. You can use the factor directly: lm(x ~ month.) By the way,

Re: [R] Ubuntu vs Mac OS X

2008-04-25 Thread Roy Mendelssohn
On Apr 25, 2008, at 4:34 PM, Guillaume Blanchet wrote: Hi ! I have installed R-2.7.0 64-bits on a computer where the new Ubuntu version (8.04) was installed. This computer is a 3.2 GHz Dual-core with 2 Gb of RAM. To test how fast (I though !) this machine is, I compared two simple

[R] R question about prediction from a fitted model

2008-04-25 Thread Lisa
Hi, I have a question about predicting new values from a fitted model in R. For example, if i fit a linear model fit-lm(y~x) predict(fit) will give the fitted values for each x. I am wondering if there is a way to do some prediction of the fitted for some new values of x that are not in the

Re: [R] R question about prediction from a fitted model

2008-04-25 Thread Jorge Ivan Velez
Hi Lisa, See examples in ?predict.lm HTH, Jorge On Fri, Apr 25, 2008 at 7:47 PM, Lisa [EMAIL PROTECTED] wrote: Hi, I have a question about predicting new values from a fitted model in R. For example, if i fit a linear model fit-lm(y~x) predict(fit) will give the fitted values for

[R] Summarize data for MCA (FactoMineR)

2008-04-25 Thread Nelson Castillo
Hi :-) I'm new to R and I started using it for a project (I'm the CS guy in a group of statisticians helping them find out how to solve issues as they come out). This is my first post to the list and I am starting to learn R. Well, they were used to doing MCA analysis in other programs where the

[R] Details regarding the nnet package

2008-04-25 Thread Colin Blake Rickert
Hello, I've recently been using the nnet package to do some basic forecast predictions. I've found the package to be quite useful and I am getting some good results. However, I am in the midst of writing a small paper on the results I am getting and wish to clarify some things about the

[R] function clogit

2008-04-25 Thread Carmen Lishman
Hello, I am using the clogit (conditional logistic regression) on a simple data set which is not related to survivorship, which I understand to be fine. I have trouble understanding the output. I would like to find parameter estimates of the logistic models I am constructing with R, and am

Re: [R] R question about prediction from a fitted model

2008-04-25 Thread Lisa
Hi Jorge, thank you very much for your reply. I checked and have got the prediction of new values for lm or glm or nls, the new question is, is there any prediction for the cox model? I tried predict(Surv(y~x),newdata), it only gave the fitted values. Any clue on this? thanks a lot! On