[R] quantcut

2008-11-03 Thread Kåre Edvardsen
I'm trying to devide x into tertiles, but ends up with integer limits even x holds one decimal. The analysis is extremely sensitive to the limits and I like to keep them right. How can that be done? quartiles - quantcut( x[x = 0], q=seq(0,1, by=(1/3)) table(quartiles) quartiles [180,344]

[R] Trying to pass arrays as arguments to a function

2008-10-20 Thread Kåre Edvardsen
I'd like to avoid looping through an array in order to change values in the array as it takes too long. I red from an earlier post it can be done by do.call but never got it to work. The Idea is to change the value of y according to values in x. Wherever x holds the value 3, the corresponding

[R] Extended summary

2008-10-14 Thread Kåre Edvardsen
Is there a function providing more descriptive statistics than summary()? I'm working with a coxph analyses and would like to have more info on certain numbers. If my call is something like: Call: coxph(formula = Surv(followup, CasesCancer) ~ age + BMI + parity + HRT) I'd like to know: * How

Re: [R] Difference in p-values between R and SPSS

2008-09-12 Thread Kåre Edvardsen
I thought the difference is to big too, so I tried both breslow and efron with same different result, and exact goes for ever, which is strange as I'm only using one dependent varable here. Could be that n~50.000, and I haven't got the most powerful computer either. I'm not aiming to get equal

[R] Difference in p-values between R and SPSS

2008-09-11 Thread Kåre Edvardsen
My apologies for asking slightly about SPSS in addition to R... Could not find an exact answer in the archives on whether R and SPSS may give different p-vals when output for coeffs and conf-intervals are the same. Amyway, a colleague and I are doing a very simple coxreg analyses and get the same

[R] Summary information

2008-06-24 Thread Kåre Edvardsen
Hi all! I'm doing a coxph analyses on some 50.000 subjects. Is there a simple function in R that provide some general model information like: Summary of the number of event and Cencored values like in SAS? I'm working together with someone using SAS and the summary function in R does not

[R] Strange julian and/or strptime

2008-05-23 Thread Kåre Edvardsen
Hi r-helpers... Why do I get this strange huge jump of 36524 days when changing origin from 1969-01-01 to 1968-12-31. It should still be close to zero! This really messes up my calculations of follow-up times in my analyses. julian(strptime(010169, format = %d%m%y),origin = as.Date(1969-01-01))

Re: [R] Strange julian and/or strptime

2008-05-23 Thread Kåre Edvardsen
-- the posting guide asked for your OS 'at a minimum', but as you didn't follow it so we have no idea which you used. On Fri, 23 May 2008, Kåre Edvardsen wrote: Hi r-helpers... Why do I get this strange huge jump of 36524 days when changing origin from 1969-01-01 to 1968-12-31

Re: [R] Overall p-value from a factor in a coxph fit

2008-04-21 Thread Kåre Edvardsen
, 2008 at 3:06 AM, Kåre Edvardsen [EMAIL PROTECTED] wrote: Hi all. If I run the simple regression when x is a categorical variable ( x - factor(x) ): MyFit -coxph( Surv(start, stop, event) ~ x ) How can I get the overall p-value on x other than for each dummy variable

[R] Overall p-value from a factor in a coxph fit

2008-04-18 Thread Kåre Edvardsen
Hi all. If I run the simple regression when x is a categorical variable ( x - factor(x) ): MyFit -coxph( Surv(start, stop, event) ~ x ) How can I get the overall p-value on x other than for each dummy variable? anova(MyFit) does NOT provide that information as previously suggested on the