Displaying 6 results from an estimated 6 matches for "linp".
Did you mean:
line
2006 Oct 27
1
Censored Brier Score and Royston/Sauerbrei's D
...lt;- read.csv(file='c:\\....
time <- data$time # The time in years from diagnosis of cancer to
death
status <- data$status # The status at last follow-up: 1=dead, 0=alive
pred <- data$pred # The predicted probability of surviving 5 years
after cancer from external Cox model A
linp <- data$linp # The linear predictor of external Cox model B
predicting survival after cancer
s <- Surv(time, status)
test <- sbrier(s, pred, btime=5)
# I get this error message that I can't seem to solve
Error in Surv(time, 1 - cens) : Time variable is not numeric
In addition: W...
2012 Feb 13
3
mgcv: increasing basis dimension
...pected gcv to decrease when increasing the
basis dimension, as I thought this would minimise gcv over a larger
subspace. But gcv increased. Here's an example. thanks for any comments.
greg
#simulate some data
set.seed(0)
x1<-runif(500)
x2<-rnorm(500)
x3<-rpois(500,3)
d<-runif(500)
linp<--1+x1+0.5*x2+0.3*exp(-2*d)*sin(10*d)*x3
y<-rpois(500,exp(linp))
sum(y)
library(mgcv)
#basis dimension k=5
m1<-gam(y~x1+x2+te(d,bs="ts")+te(x3,bs="ts")+te(d,x3,bs="ts"),family="poisson")
#basis dimension k=10
m2<-gam(y~x1+x2+te(d,bs="ts&quo...
2012 Sep 25
1
REML - quasipoisson
...d by gam and
the formula (4) on p.4 here:
http://opus.bath.ac.uk/22707/1/Wood_JRSSB_2011_73_1_3.pdf
I'm ok with this for poisson, or for quasipoisson when phi=1.
However, when phi differs from 1, I'm stuck.
#simulate some data
library(mgcv)
set.seed(1)
x1<-runif(500)
x2<-rnorm(500)
linp<--0.5+x1+exp(-x2^2/2)*sin(4*x2)
y<-rpois(500,exp(linp))
##poisson
#phi=1
m1<-gam(y~s(x1)+s(x2),family="poisson",method="REML")
phi<-m1$scale
#formula
#1st term
S1<-m1$smooth[[1]]$S[[1]]*m1$sp[1]
S2<-m1$smooth[[2]]$S[[1]]*m1$sp[2]
S<-matrix(0,19,19)
for (i...
2010 Oct 21
1
gam plots and seWithMean
...er the covariate values), except for the smooth concerned".
an example with a poisson gam
(re-run this a few times as the plots can vary significantly)
-------
library(mgcv)
#simulate some data
x1<-runif(500)
x2<-rnorm(500)
x3<-rpois(500,3)
d<-runif(500)
t<-runif(500,20,50)
linp<--6.5+x1+2*x2-x3+2*exp(-2*d)*sin(2*pi*d)
lam<-t*exp(linp)
y<-rpois(500,lam)
sum(y)
table(y)
#fit the data without d by glm and with d by gam
f1<-glm(y~offset(log(t))+x1+x2+x3,poisson)
f2<-gam(update.formula(as.formula(f1),~.+s(d)),poisson)
anova(f1,f2)
summary(f2)
plot(f2)
#the sol...
2012 Oct 01
0
[Fwd: REML - quasipoisson]
...s.bath.ac.uk/22707/1/Wood_JRSSB_2011_73_1_3.pdf
>
> I'm ok with this for poisson, or for quasipoisson when phi=1.
>
> However, when phi differs from 1, I'm stuck.
>
> #simulate some data
> library(mgcv)
> set.seed(1)
> x1<-runif(500)
> x2<-rnorm(500)
> linp<--0.5+x1+exp(-x2^2/2)*sin(4*x2)
> y<-rpois(500,exp(linp))
>
> ##poisson
> #phi=1
> m1<-gam(y~s(x1)+s(x2),family="poisson",method="REML")
> phi<-m1$scale
>
> #formula
> #1st term
> S1<-m1$smooth[[1]]$S[[1]]*m1$sp[1]
> S2<-m1$smoo...
2008 May 28
2
Linear Programming.
An embedded and charset-unspecified text was scrubbed...
Name: n?o dispon?vel
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080528/96325940/attachment.pl>