Displaying 7 results from an estimated 7 matches for "xbeta".
Did you mean:
beta
2004 Jun 17
0
beta regression in R
...returns
reasonable answers for all of these compared with the identical optimization
problems in STATA and LIMDEP. However, I'm having a problem with beta
regression. The parameterization of beta regression that I am using solves
for the second distributional parameter in terms of the first and xbeta.
Therefore, there is only a single distribution parameter. This
parameterization works fine in STATA, LIMDEP, and SHAZAM. However, the
results returned by optim in R are not reasonable in terms of the value of
the log likelihood and parameter estimates.
Here is my code. Does anyone see a problem w...
2009 Feb 23
1
predicting cumulative hazard for coxph using predict
...008666 3 0.3026852 1 MA 2295.891 0
4 1008666 4 46.7493287 1 MA 2296.193 0
5 1008666 5 61.9772917 1 MA 2342.943 0
6 1008666 5 100.9964815 1 MA 2404.920 0
If I estimate predict(m,newdata,type="lp") does the output include xbeta or does it include xbeta+frailty term?
?
I want to predict the cumulative hazard for each person for their next event at a given time in future.What is the best way to compute it?
Currently I am doing it by pulling the different elements and putting them together using my own code.
For example, I...
2007 May 18
1
A programming question
...independent variable keeping the others constant.
A simple toy example is like this
Range for my variables is defined as follows
y=0 or 1, x1 = -10 to 10, x2=-40 to 100, x3 = -5 to 5
Model
output <- glim(y ~ x1+x2+x3 -1, family=binomial(link="probit"))
outcoef <- output$coef
xbeta <- as.matrix(cbind(x1, x2, x3)
predprob <- pnorm(xbeta%*%outcoef)
now I have the predicted probabilities for y=1 as defined above. My problem is as follows
Keep X2 at 20 and X3 at 2. Then compute the predicted probability (predprob) for the entire range of X1 ie from -10 to 10 with an incr...
2011 Jun 14
1
Using MLE Method to Estimate Regression Coefficients
...it to work...
x<- cbind(1,x1,x2,x3)
y<- as.vector(y)
ones<- x[,1]
# Calculate K and n for later use
K <- ncol(x)
K
[1] 4
K1 <- K + 1
n <- nrow(x)
n
[1] 81
# Define the function to be optimized
llik.regress <- function(par,X,Y) {
X <- as.matrix(x)
Y <- as.vector(y)
xbeta <- X%*%par[1:K]
Sig <- par[K1:K1]
sum(-(1/2)*log(2*pi)-(1/2)*log(Sig^2)-(1/(2*Sig^2))*(Y-xbeta)^2)
}
llik.regress
# Now let's use the above function to estimate the model.
model <- optim(c(1,1,1,1), llik.regress, method="BFGS", control=list(fnscale=-1),
hessi...
2006 Jun 16
6
modeling logit(y/n) using lrm
I have a dataset at a hospital level (as opposed to the patient level)
that contains number of patients experiencing events (call this number
y), and the number of patients eligible for such events (call this
number n). I am trying to model logit(y/n) = XBeta. In SAS this can be
done in PROC LOGISTIC or GENMOD with a model statement such as: model
y/n = <predictors>;. Can this be done using lrm from the Hmisc library
without restructuring the dataset so that for each hospital there is one
row with y = 1 and one row with y = 0 and then using the...
2010 Nov 24
2
Is there an equivalent to predict(..., type="linear") of a Proportional hazard model for a Cox model instead?
Hi all,
Is there an equivalent to predict(...,type="linear") of a Proportional hazard
model for a Cox model instead?
For example, the Figure 13.12 in MASS (p384) is produced by:
(aids.ps <- survreg(Surv(survtime + 0.9, status) ~ state + T.categ +
pspline(age, df=6), data = Aidsp))
zz <- predict(aids.ps, data.frame(state = factor(rep("NSW", 83), levels =
2009 Aug 21
0
data layout for crossed factors w/interaction in linear mix models
...1 (1x1)
y112 1 1 1 "
y121 1 1 2 2 (1x2)
y122 1 1 2 "
y123 1 1 2 "
y131 1 1 3 3 (1x3)
. . . . .
. . . . .
2) using the design matrix from Y = XBeta +Zb. That is, using the same first two columns as above, but substituting 1020 columns (10 for ai's, 10 for bj's and 100 for abij's) for the last three columns.
I get the message: "Error in eval(predvars, data, env) : invalid envir argument"
Is my data layout mispecified? D...