Displaying 3 results from an estimated 3 matches for "newx2".
Did you mean:
newx
2003 Dec 16
0
Help w/ termplot & predict.coxph/ns
...correct
values for the actual data set used in the fitting:
max(predict(model.fit)-model.fit$linear.predictors)=0. Am I missing
something here?
3. Using the fitted coeficients:
# Coefficients
fitc<-coef(model.fit)
# Predictors
basis <- ns(x2, df = 3) ; # df= 3 were used to fit the model
newx2<- seq(0,30,length=60)
# new data in the coords of the basis and x1=1 for all obs
newdata2<-cbind(rep(1,60),predict(basis, newx2))
newpred<-newdata2%*%fitc
termplot(model.fit, ylim=c(0,3))
lines(newx2, newpred)
This method gives predictions that appear to be proportional to the
results i...
1999 Jun 07
1
data.frame
...splines, with syntax similar to lm and glm. In a formula
say y~x1*x2, x1 or x2 or both can be multivariate. The corresponding
predict function also has syntax similar to that of lm. To prepare
newdata to be used in predict(object,newdata,...), I can use
> newdata <- data.frame(x1=newx1,x2=newx2)
only for univariate x1 and x2. For multivariate predictors, I have to
fake it by using
> newdata <- model.frame(~x1+x2,list(x1=newx1,x2=newx2))
Chong Gu
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/...
2008 Oct 22
0
newbie Syntax questions: Re-Calculating expansion factors
...TargetX2Sums <- xtabs(~tripid_nu, data= TargetX1Sums)
InitX1Sums <- xtabs(~tripid_nu+lineon, data=SurveyData)
SurveyData$NewX1= ##{some formulation of TargetX1Sums/InitX1Sums,
selecting by tripid_nu/lineon }##
InitX2Sums <- xtabs(NewX1~tripid_nu, data=SurveyData)
SurveyData$NewX2= ##{some formulation of TargetX2Sums/InitX2Sums
selecting by tripid_nu }##
Am I thinking of this correctly? What data structures/classes should I
be using? What is the syntax for the type of calculation I'm trying to
do? How should I specify my new X1 target data file so I can use...