[R] Difference in offset values in R and STATA

2020-04-14 Thread Haddison Mureithi
Hae guys,
When performing a poisson regression sometimes one has to input the
offset/exposure variable to account for individual time spent in a certain
therapy before acquiring a certain condition of interest, whereby in r
offset(log(months)) and in STATA offset(log(months)) results differ.
Thereby increasing the difference of the overall outcome, i don't know why
any one know why?

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Survuval Anaysis

2019-05-02 Thread Haddison Mureithi
Hello guys this problem was never answered and I happened to come across
the same problem , kindly help. This is a simple R program that I have been
trying to run. I keep running into the "singular matrix" error. I end up
with no sensible results. Can anyone suggest any changes or a way around
this?

I am a total rookie when working with R.

Thanks,
Haddison

> library(survival)
Loading required package: splines
> args(coxph)
function (formula, data, weights, subset, na.action, init, control,
method = c("efron", "breslow", "exact"), singular.ok = TRUE,
robust = FALSE, model = FALSE, x = FALSE, y = TRUE, tt, ...)
NULL
> test1<-read.table("S:/FISHDO/03_Phase_I_Field_Work/Data_6_28_2011/Working
Folder/R_files/4SondesJuly24.csv", header=T, sep=",")
> sondes<-coxph(Surv(Start, Stop, Depart)~DOLoomis + DOI55 + DODamen,
data=test1)
Warning messages:
1: In fitter(X, Y, strats, offset, init, control, weights = weights,  :
  Loglik converged before variable  1,2 ; beta may be infinite.
2: In coxph(Surv(Start, Stop, Depart) ~ DOLoomis + DOI55 + DODamen,  :
  X matrix deemed to be singular; variable 3
> summary(sondes)
Call:
coxph(formula = Surv(Start, Stop, Depart) ~ DOLoomis + DOI55 +
DODamen, data = test1)

  n= 1737, number of events= 58
   (1 observation deleted due to missingness)

   coef  exp(coef)   se(coef)  z Pr(>|z|)
DOLoomis -2.152e+00  1.163e-01  1.161e+05  01
DOI55 4.560e-01  1.578e+00  3.755e+04  01
DODamen  NA NA  0.000e+00 NA   NA

 exp(coef) exp(-coef) lower .95 upper .95
DOLoomis0.1163 8.5995 0   Inf
DOI55   1.5777 0.6338 0   Inf
DODamen NA NANANA

Concordance= 0.5  (se = 0 )
Rsquare= 0   (max possible= 0.01 )
Likelihood ratio test= 0  on 2 df,   p=1
Wald test= 0  on 2 df,   p=1
Score (logrank) test = 0  on 2 df,   p=1

On Wed, 1 May 2019, 1:00 pm ,  wrote:

> Send R-help mailing list submissions to
> r-help@r-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://stat.ethz.ch/mailman/listinfo/r-help
> or, via email, send a message with subject or body 'help' to
> r-help-requ...@r-project.org
>
> You can reach the person managing the list at
> r-help-ow...@r-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-help digest..."
>
>
> Today's Topics:
>
>1. Re: Bug in R 3.6.0? (Martin Maechler)
>2. Re: Bug in R 3.6.0? (o...@free.fr)
>3. Time series (trend over time) for irregular sampling dates
>   and multiple sites (=?UTF-8?Q?Catarina_Serra_Gon=C3=A7alves?=)
>4. Re:  Time series (trend over time) for irregular sampling
>   dates and multiple sites (Bert Gunter)
>5. Passing formula as parameter to `lm` within `sapply` causes
>   error [BUG?] (Jens Heumann)
>6. (no subject) (Haddison Mureithi)
>7. Help with loop for column means into new column by a subset
>   Factor w/131 levels (Bill Poling)
>8. Re: Help with loop for column means into new column by a
>   subset Factor w/131 levels (Bill Poling)
>9. transpose and split dataframe (Matthew)
>   10. Re: transpose and split dataframe (David L Carlson)
>   11. Re: Passing formula as parameter to `lm` within `sapply`
>   causes error [BUG?] (David Winsemius)
>   12. Fwd: Re:  transpose and split dataframe (Matthew)
>   13. Re: transpose and split dataframe (Jim Lemon)
>   14. Re:  Time series (trend over time) for irregular sampling
>   dates and multiple sites (Abs Spurdle)
>   15. Re: Fwd: Re:  transpose and split dataframe (David L Carlson)
>   16. Re: Passing formula as parameter to `lm` within `sapply`
>   causes error [BUG?] (Duncan Murdoch)
>   17. Re:  Time series (trend over time) for irregular sampling
>   dates and multiple sites (Abs Spurdle)
>   18. Re:  Time series (trend over time) for irregular sampling
>   dates and multiple sites (Abs Spurdle)
>   19. Re: Passing formula as parameter to `lm` within `sapply`
>   causes error [BUG?] (Jens Heumann)
>   20. Re: Passing formula as parameter to `lm` within `sapply`
>   causes error [BUG?] (peter dalgaard)
>
> --
>
> Message: 1
> Date: Tue, 30 Apr 2019 16:54:10 +0200
> From: Martin Maechler 
> To: Morgan Morgan 
> Cc: 
> Subject: Re: [R] Bug in R 3.6.0?
> Message-ID: <23752.24978.45927.96...@stat.math.ethz.ch>
> Content-Type: text/plain; charset="utf-8"
>
> >>>>> Morgan Morgan
> >>>>> on Mon, 29 Apr 2019 21:42:36 +0100 writes:
>

[R] (no subject)

2019-04-30 Thread Haddison Mureithi
Hello guys this problem was never answered and I happened to come across
the same problem , kindly help. This is a simple R program that I have been
trying to run. I keep running into the "singular matrix" error. I end up
with no sensible results. Can anyone suggest any changes or a way around
this?

I am a total rookie when working with R.

Thanks,
Rasika

> library(survival)
Loading required package: splines
> args(coxph)
function (formula, data, weights, subset, na.action, init, control,
method = c("efron", "breslow", "exact"), singular.ok = TRUE,
robust = FALSE, model = FALSE, x = FALSE, y = TRUE, tt, ...)
NULL
> test1<-read.table("S:/FISHDO/03_Phase_I_Field_Work/Data_6_28_2011/Working
Folder/R_files/4SondesJuly24.csv", header=T, sep=",")
> sondes<-coxph(Surv(Start, Stop, Depart)~DOLoomis + DOI55 + DODamen,
data=test1)
Warning messages:
1: In fitter(X, Y, strats, offset, init, control, weights = weights,  :
  Loglik converged before variable  1,2 ; beta may be infinite.
2: In coxph(Surv(Start, Stop, Depart) ~ DOLoomis + DOI55 + DODamen,  :
  X matrix deemed to be singular; variable 3
> summary(sondes)
Call:
coxph(formula = Surv(Start, Stop, Depart) ~ DOLoomis + DOI55 +
DODamen, data = test1)

  n= 1737, number of events= 58
   (1 observation deleted due to missingness)

   coef  exp(coef)   se(coef)  z Pr(>|z|)
DOLoomis -2.152e+00  1.163e-01  1.161e+05  01
DOI55 4.560e-01  1.578e+00  3.755e+04  01
DODamen  NA NA  0.000e+00 NA   NA

 exp(coef) exp(-coef) lower .95 upper .95
DOLoomis0.1163 8.5995 0   Inf
DOI55   1.5777 0.6338 0   Inf
DODamen NA NANANA

Concordance= 0.5  (se = 0 )
Rsquare= 0   (max possible= 0.01 )
Likelihood ratio test= 0  on 2 df,   p=1
Wald test= 0  on 2 df,   p=1
Score (logrank) test = 0  on 2 df,   p=1

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.