Hi, I am writing a BRugs code and I need to specify the likelihood for the
gamma distribution and I am specifying it as the pdf:
(pow(b1,a1)/(exp(loggam(a1)))*(exp(-b1*lambda[i]))*pow(lambda[i],(a1-1)))
But it is not accepting it although I know that I could use the pdf in R to
estimate the
Hi, 2 questions:
Question 1: example of what I currently do:
for(i in 1:6){sink(temp.txt,append=TRUE)
dput(i+0)
sink()}
x=scan(file=temp.txt)
print(prod(x))
file.remove(C:/R-2.5.0/temp.txt)
But how to convert the output of the loop to a vector that I can manipulate
(by prod or sum etc),
There is a C program called GPS: 'gamma poisson shrinker' at
ftp://ftp.research.att.com/dist/gps/
The algorithms in GPS are based on S-Plus programs written by William
DuMouchel with support from Columbia University and ATT Labs.
My question is: is there a relatively easy way to extract some of
Dear R-help users, I have a question concerning re-writing a function in R:
Suppose I have the data, y is number of successes and N is total number of
trials and x is the variable
(example:)
x y N
1 10 150
0 1 100
I want to estimate the risk ratio by
I'm sorry that this question has been asked before but I ask it again because
in the archives I didn't see a solution. It's an old S-plus dmp file for a
hierarchical bayes linear model program written by DuMouchel and available
publicly and freely at:
Dears, I have the below code for metropolis of the GLM logit (logistic
regression) using a flat prior. Can someone help me modify the prior so that
the model becomes hierarchical by using a flat prior for mu and sigma, the
derived density for beta ~ N(mu, sigma^2)? Actually I took my code from a
We were promised this package last spring but I can't find it anywhere! Does
anyone have any info? Thanks.
From RNews:
Umacs (Universal Markov chain sampler) is an R package (to be released in
Spring 2006) that facilitates
the construction of the Gibbs sampler and Metropolis algorithm for
Hello, I am trying to shrink the coefficients of a logistic regression for a
sparse dataset, I am using the lasso (lasso2) and I am trying to determine
the shrinkinage factor by cross-validation. I would like please some of the
experts here to tell me whether i'm doing it correctly or not. Below
At the alpha level you set, A is neither greater nor less than B. Supposing
you don't use paired t.test:
data: c(10, 20, 30) and c(25, 30, 15)
t = -0.4588, df = 3.741, p-value = 0.6717
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
Hi, yes I know but in many cases BUGS and BRUGS just crash or worse still
they can generate wrong results that's why i was wondering if there's a
package like the MCMCpack etc that can allow hierarchical regression...
Cody_Hamilton wrote:
Franco,
What about calling the BUGS model below from
I hope some of the authors of the package MCMCpack read this.
I don't know if there is a way to set the response in the model formula of
MCMClogit other than a (numeric) response vector. I think the MCMClogit in
the MCMCpack needs some development so that the response in the formula
could be set
Dear all,
I am trying to use the logistic regression with MCMClogit (package:
MCMCpack/Coda) and I want to put a beta prior on the parameters, but it's
giving me error message (please see output below) no matter what shape 1 or
2 I use. It works perfect with the cauchy or normal priors. Do you
Hi, yes but I realized afterwards that it's the logfun argument that had to
be put to logfun=F and the logpriorfun function had to be log=F
logpriorfun - function(beta,shape1,shape2){
sum(dbeta(beta,shape1,shape2,log=F)) }
But that's just for that particular example. I find I am having problems
Hello,
I have two related questions, one about MCMClogit and the other about
BRUGS:
Given the data on nausea due to diuretic and nsaid below:
nsaid diureticyes no
0 0 185 6527
0 1 53 1444
1 0 42 1293
1
This below is not solvable with uniroot to find a:
fn=function(a){
b=(0.7/a)-a
(1/(a+b+1))-0.0025
}
uniroot(fn,c(-500,500)) gives
Error in uniroot(fn, c(-500, 500)) : f() values at end points not of
opposite sign
I read R-help posts and someone wrote a function:
Or more elegantly the function below where a and b are the parameters of the
beta prior, xa and xb are the current number of events in group A and B
respectively; na and nb are the current total number of subjects in group A
and B respectively; Na and Nb are the final total number of subject in
Hello I am using the for (i...) and a sink() into a file. But the output I
am having is not arranged in either a vector or any other good structure. I
would like to have the output in a file directly as a vector so that I do
not have to edit the [1] and [6] etc and that the values are comma
OK it works thanks.
francogrex wrote:
Hello I am using the for (i...) and a sink() into a file. But the output
I
am having is not arranged in either a vector or any other good structure.
I
would like to have the output in a file directly as a vector so that I do
not have to edit the [1
Ok I am replying to my own message! I wrote a function, it works well but
it's a bit twisted because you will have to edit the last file in excel or
other.
This is to analyze the bayesian predictive power in an analysis where
treatment x is compared to treatment y. Example: Total final subject
is there no package/function in R to calculate the conditional power or the
bayesian predictive power for trials with binary endpoints? Thanks
--
View this message in context:
http://www.nabble.com/Conditional-power%2C-predictive-power-tf3603396.html#a10066991
Sent from the R help mailing list
Distributions), but i'm not comfortable yet using the bayesian methods.
On Wed, 2007-03-28 at 10:49 -0500, Douglas Bates wrote:
On 3/28/07, Marc Schwartz [EMAIL PROTECTED] wrote:
On Wed, 2007-03-28 at 02:42 -0700, francogrex wrote:
Does anyone know of an R package that is equivalent of S
Does anyone know of an R package that is equivalent of S+SeqTrial for
analysis of clinical trials using group sequential methods? Thanks.
--
View this message in context:
http://www.nabble.com/R-equivalent-of-S%2BSeqTrial--tf3478858.html#a9708877
Sent from the R help mailing list archive at
I have the model below, for which I run a logistic regression including the
interaction term (NSAID*Diuretic)
fit1=glm(resp ~ nsaid+diuretic+I(nsaid*diuretic), family= binomial,data=w)
NSAID DiureticPresent Absent
0 0 185 6527
0 1
Thanks Mark for taking the time to provide me with a very well detailed reply
and explanation. It helps a lot. Regards.
--
View this message in context:
http://www.nabble.com/Woolf%27s-test%2C-Odds-ratio%2C-stratification-tf3284589.html#a9146699
Sent from the R help mailing list archive at
Just a general question concerning the woolf test (package vcd), when we have
stratified data (2x2 tables) and when the p.value of the woolf-test is
below 0.05 then we assume that there is a heterogeneity and a common odds
ratio cannot be computed?
Does this mean that we have to try to add more
When I run the script below it works well it ouputs the result that I need,
in this case were n=45 and e=5.02689 the result is: 6.669578
---
dens-function(x){
n=45
e=5.02689
a1=0.0987
b1=0.04261
a2=1.043
b2=1.222
p=0.121
if (n200) c((n=n/2),(e=e/2))
How to formulate an analytical gradient?
Suppose I have the following function/expression:
fr-function(x){
x1=x[1]
x2=x[2]
x3=x[3]
x4=x[4]
x5=x[5]
z-((gamma(x1+n)))/((gamma(x1)*factorial(n))*((1+(e/x2))^x1)*((1+(x2/e))^n))
Hi guys again, it seems I haven't been doing the maximum likelihood
estimation correctly. I quote below, can someone explain to me please what
does it mean that the 2nd and 3rd derivatives of the function equals zero
and how to compute that in R.
We have our initial estimated, subjective
Hi Guys, it would be great if you could help me with a MLE problem in R.
I am trying to evaluate the maximum likelihood estimates of theta = (a1,
b1, a2, b2, P) which defines a mixture of a Poisson distribution and two
gamma prior distributions (where the Poisson means have a gamma
Franco,
You can provide lower and upper bounds on the parameters if you use optim
with method=L-BFGS-B.
Hth, Ingmar
Thanks, but when I use L-BFGS-B it tells me that there is an error in
optim(start, f, method = method, hessian = TRUE, ...) : L-BFGS-B needs
finite values of 'fn'
--
View this
/People/Faculty/Varadhan.html
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of francogrex
Sent: Friday, January 05, 2007 10:42 AM
To: r-help@stat.math.ethz.ch
31 matches
Mail list logo