[R] Identifying points in a plot that have duplicate values
I have code like this: - #--- -- x=scan() 0 0 0 0 0 1 2 3 4 y=scan() 1 1 1 2 2 1 3 4 5 plot(x,y) identify(0,1,3) #Allows me to select manually to identify co-ordinate (0,1) as being duplicated 3 times identify(0,2,2) #Allows me to select manually to identify co-ordinate (0,2) as being duplicated 2 times #--- -- Is there not a way I can automatically display if points are duplicated and by how many times? I thought if I 'jittered' the points ever so slightly I could get an idea of how many duplicates there are but with 100 points the graph looks very messy. Regards DaveL Click for free info on getting an MBA and make $200K/ year Need cash? Click to get a payday loan http://tagline.bidsystem.com/fc/CAaCDCZ60nyjrrOboFeUJgRjigwgNftK/ span id=m2wTlpfont face=Arial, Helvetica, sans-serif size=2 style=font-size:13.5px___BRGet the Free email that has everyone talking at a href=http://www.mail2world.com target=newhttp://www.mail2world.com/abr font color=#99Unlimited Email Storage #150; POP3 #150; Calendar #150; SMS #150; Translator #150; Much More!/font/font/span [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Cut marks on a plot's y-axis to indica te it is a truncated axis
Hi, I've plotted a Kaplan-Meier curve but the curves only range from 0.7 to 1 on the y-axis. Therefore I have used: - ylim=c(0.7,1) [although I think convention dictates that you plot 0.5 to 1 to show the median? A few papers I've read have done this]?? BUT, I would like a symbol like // (but rotated 90 degrees) to indicate that the y-axis has been truncated. I'd need to be able to specify exactly where on the axis to put the symbol as well. I couldn't find anything under par or plot for doing this Thanks for any help, DaveL Study to be a Paralegal at a school near you. Click here to get free info now. http://tagline.bidsystem.com/fc/Ioyw36XJIG4kS9LX6hifX0P6pUB4A2ryL6hnXlr q7nFKzLeaHmCnIS/ span id=m2wTlpfont face=Arial, Helvetica, sans-serif size=2 style=font-size:13.5px___BRGet the Free email that has everyone talking at a href=http://www.mail2world.com target=newhttp://www.mail2world.com/abr font color=#99Unlimited Email Storage #150; POP3 #150; Calendar #150; SMS #150; Translator #150; Much More!/font/font/span [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Cut marks on a plot's y-axis to indica te it is a truncated axis
Hi, I've plotted a Kaplan-Meier curve but the curves only range from 0.7 to 1 on the y-axis. Therefore I have used: - ylim=c(0.7,1) [although I think convention dictates that you plot 0.5 to 1 to show the median? A few papers I've read have done this]?? BUT, I would like a symbol like // (but rotated 90 degrees) to indicate that the y-axis has been truncated. I'd need to be able to specify exactly where on the axis to put the symbol as well. I couldn't find anything under par or plot for doing this Thanks for any help, DaveL Free information on becoming a Legal Assistant. Click Now! http://tagline.bidsystem.com/fc/Ioyw36XKKhNb648GlNi10yhQt8Hj9egcisvXgKE K8RmtgEBA8RI05g/ span id=m2wTlpfont face=Arial, Helvetica, sans-serif size=2 style=font-size:13.5px___BRGet the Free email that has everyone talking at a href=http://www.mail2world.com target=newhttp://www.mail2world.com/abr font color=#99Unlimited Email Storage #150; POP3 #150; Calendar #150; SMS #150; Translator #150; Much More!/font/font/span [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] (Censboot, Z-score, Cox) How to use Z-score as the statistic within censboot?
Dear R Help list, My question is regarding extracting the standard error or Z-score from a cph or coxph call. My Cox model is: - modz=cph(Surv(TSURV,STATUS)~RAGE+DAGE+REG_WTIME_M+CLD_ISCH+POLY_VS, data=kidneyT,method=breslow, x=T, y=T) I've used names(modz) but can't see anything that will let me extract the Z scores for each coefficient or the standard errors in the same way one can use coef (modz). I need to get either the se or Zscore as I am hoping to be able to use the Zscore within a statistic function used in censboot. I wish to find the proportion of times each of the variables in the cox model are significant out of the R=1000 bootstrap resamples. My current function for us with the bootstrap only gives me the coefficients: - func=function(kidneyT,indices) { kidneyT=kidneyT[indices,] modz=coxph(Surv(TSURV,STATUS)~RAGE+DAGE+REG_WTIME_M+CLD_ISCH+POLY_VS,dat a=kidneyT,method=breslow) coefficients(modz) } I would like to be able to modify the following code so modz.cens.boot$t below gives me an array of the Z-scores for each variable and each resample - not the coefficients modz.cens.boot=censboot(kidneyT, func,R=1000,sim=ordinary) modz.cens.boot I hope this is clear enough? I'm still getting to terms with the Bootstrap, having only just started trying to use it a few days ago. Any help on this would clear a massive headache for me as I've been going around in circles for hours and hours on this. Thx DaveL Click to find information on your credit score and your credit report. http://tagline.bidsystem.com/fc/Ioyw36XIe1IYw28KqOSu66l6ED7AsGYWlz4EWyK N5OTcqKjQM8gfiW/ span id=m2wTlpfont face=Arial, Helvetica, sans-serif size=2 style=font-size:13.5px___BRGet the Free email that has everyone talking at a href=http://www.mail2world.com target=newhttp://www.mail2world.com/abr font color=#99Unlimited Email Storage #150; POP3 #150; Calendar #150; SMS #150; Translator #150; Much More!/font/font/span [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] (coxph, se) Obtaining standard errors of coefficients from coxph to store
Hi all, I'm wanting to be able to find and store the z-score of coxph below: - modz=coxph(Surv(TSURV,STATUS)~RAGE+DAGE+REG_WTIME_M+CLD_ISCH+POLY_VS, data=kidneyT,method=breslow) I know summary(modz) will give me this, but how do i extract the standard error or z-score values in a similar way to obtaining the coefficients by coef(modz) ? I think it must be something to do with modz$var but I'm having a complete mental blank. I need this info so I can write a function to use within a bootstrap so I can record the number of times (proportion) each variable in the Cox PH model is actually significant over all the bootstrap resamples. Any assistance is greatly appreciated DL Click to find local singles for dating, romance and fun. http://tagline.bidsystem.com/fc/Ioyw36XJJVs581mfqGSywy0Z69Mq8VM03oVytPu 8otqP84CBZmNX2G/ span id=m2wTlpfont face=Arial, Helvetica, sans-serif size=2 style=font-size:13.5px___BRGet the Free email that has everyone talking at a href=http://www.mail2world.com target=newhttp://www.mail2world.com/abr font color=#99Unlimited Email Storage #150; POP3 #150; Calendar #150; SMS #150; Translator #150; Much More!/font/font/span [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Loop and loop output [Cox model, for, function, loglik]
Dear R users, Below I have written 4 functions CIT1, CIT2a and CIT2b and CIT3 which recode a variable CLD_ISCH into 3 new variables(T1 T2 T3), I wish to use T1, T2 and T3 based on the values of tf1 and tf2. (NOTE:- T2a is used to create T2 in a long winded manner due to my lack of programming experience) I then attach T1 T2 and T3 to a dataset KidneyT that contains other variables i wish to use in a Cox regression model. I require the log likelihood statistic of a Cox model when variables T1 T2 T3 and some from KidneyT are fitted. ( coxmodel$loglik[2] ) ## I can get this to work fine for specified values of tf1 and tf2, but wish to get the loglikelihood value for many combinations of tf1 and tf2 which are times from 1 to 50 hours i.e I need loglik statistic when tf1 =1 and tf2 = 1 to 50, tf1=2 and tf2=1 to 50. I'd like to do this in increments of 0.5 hours. Ideally I'd like to end up with a matrix/array like tf1 tf2 loglik 1 0.5 -1200 1 1 -1250 1 1.5 -1251 2 0.5 -1252 2 1 -1249 2 1.5 -1159 etc. In the hope of finding a maximum for loglik. ## I've looked into loops and apply and many other functions but can't seem to get what i want. Any suggestions would be fantastic - else I'll be doing hundreds of calculations 1 at a time - ah! Code is below: - sorry for not including an example dataset. Am hoping the code itself. If not pls say and i'll try and repost with a small example dataset. # tf1=11 tf2=18 CIT1=function(var1,bp1){ { ifelse (var1=bp1,(var1=var1),(bp1)) } } T1=CIT1(CLD_ISCH,tf1) #--- ---# CIT2a=function(var1,var2,bp1){ { ifelse (var1=bp1,(var1=0),(var1=var2-bp1)) } } T2a=CIT2a(CLD_ISCH,CLD_ISCH,tf1) #--- ---# CIT2b=function(var1,var2,bp1,bp2){ { ifelse (var1(bp2-bp1),(var1=bp2-bp1),(var1=T2a)) } } T2=CIT2b(T2a,T2a,tf1,tf2) #--- ---# CIT3=function(var1,var2,bp2){ { ifelse (var1=bp2,(var1=0),(var1=var2-bp2)) } } T3=CIT3(CLD_ISCH,CLD_ISCH,tf2) #--- ---# #--- ---# newdata=data.frame(T1,T2,T3,kidneyT) attach(newdata) coxmodel=coxph(Surv(TSURV,STATUS)~RAGE+DAGE+REG_WTIME_M+POLY_VS+T1+T2+T3 , method=breslow, data=newdata) coxmodel$loglik[2] ## Regards and Thx DaveL Buying or selling a home? Click here for free info on real estate services. http://tagline.bidsystem.com/fc/Ioyw36XILaXQaXpqHLyCgxKj2HWmH06KAobcQpI xUGTio1SLafTDjw/ span id=m2wTlpfont face=Arial, Helvetica, sans-serif size=2 style=font-size:13.5px___BRGet the Free email that has everyone talking at a href=http://www.mail2world.com target=newhttp://www.mail2world.com/abr font color=#99Unlimited Email Storage #150; POP3 #150; Calendar #150; SMS #150; Translator #150; Much More!/font/font/span [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.