similar to: survival package - pspline

Displaying 20 results from an estimated 600 matches similar to: "survival package - pspline"

2006 Sep 22
2
inequality with NA
Dear everybody! take a<-c(5,3,NA,6). if(a[1]!=NA){b<-7} if(a[3]!=5){b<-7} if(a[3]!=NA){b<-7} if(a[3]==NA){b<-7} will alltogeather return Fehler in if (a[1] != NA) { : Fehlender Wert, wo TRUE/FALSE n?tig ist (or simularly). Somehow this is logical. But how else should I get out, whether a certain vector-component has an existing value? Thank you in advance! Yours, Mag. Ferri
2012 Oct 20
2
can't find the error in if function... maybe i'm blind?
Hi everybody, the following alway gives me the error "Fehler in if (File$X.Frame.Number[a] + 1 == File$X.Frame.Number[a + 1]) (File$FishNr[a] <- File$FishNr[a - : Fehlender Wert, wo TRUE/FALSE n?tig ist". Maybe its stupid, but i'm not getting why... Maybe someone can help me. Thanks a lot! for (i in unique(BigFile$TrackAll)) { File <-
2008 Aug 13
2
Tiny help for tiny function
I just started to write tiny functions and therefore I appologise in advance if I am asking stupid question. I wrote a tiny function to give me back from the original matrix, a matrix showing only the values smaller -0.8 and bigger 0.8. y<-c(0.1,0.2,0.3,-0.8,-0.4,0.9) x<-c(0.5,0.3,0.9,-0.9,-0.7,0.3) XY<-rbind(x,y) extract.values<-function (x) { if(x>=0.8|x<=-0.8)x
2012 Nov 05
1
Error message in nmkb()
Hallo together, I am trying to use the nmkb() optimizer and I have problems using the function, as it causes the following error message Fehler (error)* in while (nf < maxfeval & restarts < restarts.max & dist > ftol & : Fehlender Wert (missing value)* , wo (where)* TRUE/FALSE n?tig ist (is required)* *translation Do I need to adjust the control ?
2010 Oct 03
1
Modifying a data.frame
Hello list members I have a problem with modifying a data.frame. As an example given is a data.frame called ex : ex<-data.frame(id=c(1,2,3,4,5,6),obs=c(14,9,20,36,55,47),eff=c("A","A","B","C","C","C")) After that I would like to modify the object ex with the following short script: for (i in ex) { if(ex[i,3]=="A"||
2013 Feb 28
2
predict.smooth.Pspline function not found
I have a simple question that irritatingly I haven't been able to figure out on my own. It seems that some functions from the "Pspline" package are successfully installed while others are not. The code with which I'm working is more complicated, but the following highlights my problem. If I run the following code > tt <- seq (0,1,length=20) > xt <- tt^3 > fit
2010 Feb 01
3
playwith error message
Hi, I'am using the playwith library to write my own small GUI application. But I get the following error under Windows and Linux (Ubuntu): Error in if ((modeOK %in% c("Identify", "Brush")) && (actions$ident == : Fehlender Wert, wo TRUE/FALSE n?tig ist Under linux my R program simply continues, but under Windows it stops. Since it is not in my code, has anyone
2003 Apr 01
2
predict in Pspline package (PR#2714)
To whom it may concern, I don't know whether this is really a bug with the Pspline package or only a problem with my installation. Things work fine in Linux but not in Mac OS X (Darwin). Both system run the latest public versions of R and Pspline. predict.smooth.Pspline produces only NaN instead of predicted values when norder>2: > library (Pspline) > tt <- seq
2002 Nov 25
2
Pspline smoothing
Dear all, I'm trying to use the Pspline add-on package to fit a quintic spline (norder =3), but I keep running into a Singularity error. > traj.spl <- smooth.Pspline(time, x, norder=3 ) Error in smooth.Pspline(time, x, norder = 3) : Singularity error in solving equations > Playing around with the other parameters produces an "unused arguments" error: > traj.spl
2011 Apr 06
1
help on pspline in coxph
Hi there, I have a question on how to extract the linear term in the penalized spline in coxph. Here is a sample code: n=100 set.seed(1) x=runif(100) f1 = cos(2*pi*x) hazard = exp(f1) T = 0 for (i in 1:100) { T[i] = rexp(1,hazard[i]) } C = runif(n)*4 cen = T<=C y = T*(cen) + C*(1-cen) data.tr=cbind(y,cen,x) fit=coxph(Surv(data.tr[,1],
2008 Mar 22
2
intraday OHLC plot
I want to create a open/high/low/last plot of intraday data. I try to use the function plotOHLC from the tsteries package. I create my own multiple time series and then try to plot it. raw Data Format (file eurusd2.csv): "Date (GMT)" "Open" "High" "Low" "Last" 17-03-2008 00:00:00 1,5764 1,5766 1,5747 1,5750 17-03-2008 00:05:00 1,5749 1,5750 1,5741
2003 Jan 22
1
something wrong when using pspline in clogit?
Dear R users: I am not entirely convinced that clogit gives me the correct result when I use pspline() and maybe you could help correct me here. When I add a constant to my covariate I expect only the intercept to change, but not the coefficients. This is true (in clogit) when I assume a linear in the logit model, but the same does not happen when I use pspline(). If I did something similar
2011 May 29
1
Fitting spline using Pspline
Hey all, I seem to be having trouble fitting a spline to a large set of data using PSpline. It seems to work fine for a data set of size n=4476, but not for anything larger (say, n=4477). For example: THIS WORKS: ----------------------------- random = array(0,c(4476,2)) random[,1] = runif(4476,0,1) random[,2] = runif(4476,0,1) random = random[order(random[,1]),] plot(random[,1],random[,2])
2010 Nov 17
1
where are my pspline knots?
Hi All, I am trying to figure out how to get the position of the knots in a pspline used in a cox model. my.model = coxph(Surv(agein, ageout, status) ~ pspline(x), mydata) # x being continuous How do I find out where the knot of the spline are? I would like to know to figure out how many cases are there between each knot. Best, Federico -- Federico C. F. Calboli Department of Epidemiology
2009 Jan 07
1
troubles performing Moran.I test
dear R users, I have troubles performing Moran.I test as suggested on http://www.ats.ucla.edu/stat/r/faq/morans_i.htm my spatial data are longitude and lattitide of communities. The calculation of the inverse distance matrix according to the homepage (using my data) datAL <- read.csv2("C:\\Konvergenz AL.csv", header=T) ALdist <- as.matrix(dist(cbind(datAL$L?nge,
2008 May 09
1
predicting from coxph with pspline
Hello. I get a bit confused by the output from the predict function when used on an object from coxph in combination with p-spline, e.g. fit <- coxph(Surv(time1, time2, status)~pspline(x), Data) predict(fit, newdata=data.frame(x=1:2)) It seems like the output is somewhat independent of the x-values to predict at. For example x=1:2 gives the same result as x=21:22. Does the result span the
2012 Aug 24
1
Fwd: Re: Package cwhmisc and problems
-------- Original-Nachricht -------- Betreff: Re: Package cwhmisc and problems Datum: Fri, 24 Aug 2012 07:34:14 +0100 Von: Prof Brian Ripley <ripley@stats.ox.ac.uk> An: Christian Hoffmann <c-w.hoffmann@sunrise.ch> Kopie (CC): CRAN@r-project.org This is the address for CRAN submissions. Please ask for help on R-help or R-devel. On 23/08/2012 20:16, Christian Hoffmann wrote:
2013 Mar 30
1
normal mixture EM not working?
Hi, I am currently working on fitting a mixture density to financial data. I have the following data: http://s000.tinyupload.com/?file_id=00083355432555420222 I want to fit a mixture density of two normal distributions. I have the formula: f(l)=πϕ(l;μ1,σ21)+(1−π)ϕ(l;μ2,σ22) my R code is: normalmix<-normalmixEM(dat,k=2,fast=TRUE) pi<-normalmix$lambda[1] mu1<-normalmix$mu[1]
2018 Jan 15
1
Time-dependent coefficients in a Cox model with categorical variants
Suppose I have a dataset contain three variants, looks like > head(dta) Sex tumorsize Histology time status 0 1.5 2 12.1000 0 1 1.8 1 38.4000 0 ..................... Sex: 1 for male; 0 for female., two levels Histology: 1 for SqCC; 2 for High risk AC; 3 for low risk AC,
2010 Apr 19
0
Natural cubic splines produced by smooth.Pspline and predict function in the package "pspline"
Hello, I am using R and the smooth.Pspline function in the pspline package to smooth some data by using natural cubic splines. After fitting a sufficiently smooth spline using the following call: (ps=smooth.Pspline(x,y,norder=2,spar=0.8,method=1) [the values of x are age in years from 1 to 100] I tried to check that R in fact had fitted a natural cubic spline by checking that the resulting