Displaying 12 results from an estimated 12 matches for "tfit".
Did you mean:
fit
2007 Jul 24
1
Fit t distribution
Hi all, I am trying to fit t distribution using the function "tFit" in the
library(fBasics).
I am using the code tFit(datac[[2]]) and it returns the following list.
Title:
Student-t Parameter Estimation
Call:
tFit(x = datac[[2]])
Model:
Student-t Distribution
Estimated Parameter(s):
df
78.4428
I just wonder how can I refer to the estimated p...
2008 Apr 25
3
Use of survreg.distributions
Dear R-user:
I am using survreg(Surv()) for fitting a Tobit model of left-censored longitudinal data. For logarithmic transformation of y data, I am trying use survreg.distributions in the following way:
tfit=survreg(Surv(y, y>=-5, type="left")~x + cluster(id), dist="gaussian", data=y.data, scale=0, weights=w)
my.gaussian<-survreg.distributions$gaussian
my.gaussian$name="lognormal"
my.gaussian$dist<-my.gaussian
tfit=survreg(Surv(y, y>=-5, type="left")...
2008 Dec 02
1
Left-truncated regression
...nd left-truncated it at the same
spot, so that I am able to make 2 estimations (one for censoring and one for
truncation).
I know how to make the linear regression for the left-censored variable
(hours) and how to plot the regression line into the (x,y) plot (packages
AER, Zeileis, Survival, ...):
tfit<-survreg(Surv(Hours,Hours>0,
type='left')~Yrs_Ed,data=DataWomen,dist='gaussian')
z<-predict(tfit,type="response")
plot(Yrs_Ed,Hours)
abline(tfit)
My aim is to compare the effects of truncation and censoring graphically by
plotting the two regression lines into on...
2006 Jan 19
2
Tobit estimation?
...x1, x2)
> head(D)
y x1 x2
1 0.0000000 0.86848630 2.6275703
2 0.0000000 0.88675832 1.7199261
3 2.7559349 0.38341782 0.6247869
4 0.0000000 0.02679007 2.4617981
5 2.2634588 0.96974450 0.4345950
6 0.6563741 0.92623096 2.4983289
> # Estimate it
> library(survival)
> tfit <- survreg(Surv(y, y>0, type='left') ~ x1 + x2,
data=D, dist='gaussian', link='identity')
It says:
Error in survreg.control(...) : unused argument(s) (link ...)
Execution halted
My competence on library(survival) is zero. Is it still the case t...
2008 Mar 03
1
Problem plotting curve on survival curve
Calum had a long question about drawing survival curves after fitting a Weibull
model, using pweibull, which I have not reproduced.
It is easier to get survival curves using the predict function. Here is a
simple example:
> library(survival)
> tfit <- survreg(Surv(time, status) ~ factor(ph.ecog), data=lung)
> table(lung$ph.ecog)
0 1 2 3 <NA>
63 113 50 1 1
> tdata <- data.frame(ph.ecog=factor(0:3))
> qpred <- predict(tfit, newdata= tdata, type='quantile', p=1:99/100)
> matplot(t(qpre...
2010 Oct 06
4
problem with abline
Hi All,
I am running a scatter plot and trying to add a best fit line. I use an abline function, but get no line drawn over the points. I also get no error. I arm using V 2.10.0 on Windows 7.
Here is my code, including the SAS transport file import:
require (foreign)
require (chron)
require (Hmisc)
require (lattice)
clin <- sasxport.get("y:\\temp\\subset.xpt")
attach(clin)
2012 Oct 19
1
Looping survdiff
...om umn.edu makes me wonder if there's homework involved....
Simpler for your example is to use get and subset.
dat <- structure(..... as found below
var.to.test <- names(dat)[4:6] #variables of interest
nvar <- length(var.to.test)
chisq <- double(nvar)
for (i in 1:nvar) {
tfit <- survdiff(Surv(time, completion==2) ~ get(var.to.test[i]), data=dat,
subset=(group==3))
chisq[i] <- tfit$chisq
}
write.csv(data.frame(var.to.test, chisq))
On 10/19/2012 05:00 AM, r-help-request at r-project.org wrote:
> Hello,
>
> I am trying to set up a loop that can r...
2009 Feb 09
2
CMD check puzzle
...K
* checking for portable use of $BLAS_LIBS ... OK
* creating survival-Ex.R ... OK
* checking examples ... OK
* checking tests ...
make[1]: Entering directory `/home/therneau/research/surv/Rforge/pkg/survival.Rcheck/tests'
Running 'aareg.R'
make[1]: *** [aareg.Rout] Error 1
...
> tfit <- aareg(Surv(time, status) ~ x, test1)
Error: could not find function "aareg"
Execution halted
--------------
The manual page aareg.Rd has a call to the function in the examples and that
runs ok, and aareg is in the NAMESPACE exports.
I'm almost certainly missing somethi...
2007 Dec 05
4
coxme frailty model standard errors?
Hello,
I am running R 2.6.1 on windows xp
I am trying to fit a cox proportional hazard model with a shared
Gaussian frailty term using coxme
My model is specified as:
nofit1<-coxme(Surv(Age,cen1new)~ Sex+bo2+bo3,random=~1|isl,data=mydat)
With x1-x3 being dummy variables, and isl being the community level
variable with 4 levels.
Does anyone know if there is a way to get the standard error
2012 Oct 11
2
Question on survival
Hi,
I'm going crazy trying to plot a quite simple graph.
i need to plot estimated hazard rate from a cox model.
supposing the model i like this:
coxPhMod=coxph(Surv(TIME, EV) ~ AGE+A+B+strata(C) data=data)
with 4 level for C.
how can i obtain a graph with 4 estimated (better smoothed) hazard curve
(base-line hazard + 3 proportional) to highlight the effect of C.
thanks!!
laudan
[[alternative
2008 May 12
3
help with rpart
Hi,
I am using rpart as a part of my masters' project. I am trying to print out
the resulting model using plot() function along with text() function. I am
having difficulties with labels being cut-off. In text() function, I am
using use.n=T option to get the number of people in each nodes but the on
the lower and left part of the plot, the numbers get cut off. Thanks!
Linus
[[alternative
2011 Jul 27
0
: Re: coxme frailty model standard errors?
-- begin included message --
Hi, but why we do the difference : ltemp <- 2 * diff(tfit
$loglik[1:2]) ??
Where I can find information about Integrate Likelihooh and null like
lihood??
--- end inclusion ---
1. Basic statistical fact: 2 * difference in loglik between two nested
models = distributed as a chi-square distribution. For coxme loglik[1]
= likelihood from a null model (a...