Full_Name: Oleg Raisky
Version: 1.8.1
OS: Windows 2000
Submission from: (NULL) (63.246.203.107)
This is a completely fresh R install. I'm trying to use Design package.
Every
time I run the first example for psm() I'm getting an error
<<couldn't find
function "survreg.fit">>. However, survreg.fit does exists in
the search path.
Is there something I can do to fix this?
Thanks a lot,
Oleg
Running example for psm()
> n <- 400
> set.seed(1)
> age <- rnorm(n, 50, 12)
> sex <- factor(sample(c('Female','Male'),n,TRUE))
> dd <- datadist(age,sex)
> options(datadist='dd')
> # Population hazard function:
> h <- .02*exp(.06*(age-50)+.8*(sex=='Female'))
> d.time <- -log(runif(n))/h
> cens <- 15*runif(n)
> death <- ifelse(d.time <= cens,1,0)
> d.time <- pmin(d.time, cens)
>
> f <- psm(Surv(d.time,death) ~ sex*pol(age,2),
+ dist=if(.R.)'lognormal' else 'gaussian')
Error in psm(Surv(d.time, death) ~ sex * pol(age, 2), dist = if (.R.)
"lognormal" else "gaussian") : couldn't find function
"survreg.fit">
Here is my search() output
search()
[1] ".GlobalEnv" "package:Design"
"package:Hmisc"
[4] ".GlobalTemp" "package:MASS"
"package:gregmisc"
[7] "package:grid" "package:RColorBrewer"
"package:tools"
[10] "package:vcd" "package:lattice"
"package:methods"
[13] "package:ctest" "package:mva"
"package:modreg"
[16] "package:nls" "package:ts"
"package:RODBC"
[19] "package:survival" "Autoloads"
"package:base"