[R] Gaussian quadrature for bivariate normal distribution

2012-04-19 Thread Niroshan
Dear R Users I am maximizing a likelihood function it has two two correlated random effects which follows bivariate normal distribution. To get the marginal distribution I want to integrate out with respect to these two correlated random effects. Does any body know how can I implement gaussian

[R] Maximization problem in the optim function

2012-03-14 Thread Niroshan
Dear R Users I am maximizing a user defined log likelihood function. It includes variance parameter (sigma). I used R function optim with BFGS maximization method. However, it stops before the solution saying “sqrt(sigma): NaNs produced” Could anybody know a proper transformation for sigma which

Re: [R] Maximization problem in the optim function

2012-03-14 Thread Niroshan
This is the part of the function in my likelihood function prob-function(t1,t2,m1,m2,s_r,s_p,s_e,cor_m){ if ((t1==0) (t2==0)) log_lik-log(pmvnorm(lower=rep(-Inf, 2), upper=c(m1/sqrt(s_r+s_p+s_e+1),m2/sqrt(s_r+s_p+s_e+1)), mean=rep(0,2), corr=cor_m)) else if ((t1==0) (t2==1))

[R] how to write crossed and nested random effects in a model

2012-03-13 Thread Niroshan
Dear R Users, I have a question based on my research. I am analyzing reader-based diagnostic data set. My study involves diabetic patients who were evaluated for treatable diabetic retinopathy based on the presence or absence of two pathologies in their eyes. Pathologies were identified using

[R] Two dimensional integration

2012-03-12 Thread Niroshan
Dear R Members, I want to know a fast R function to do multidimensional integration. I used the function 'cuhre' in R2cuba library. But it takes painful time to get the answer. I would be thankful if anyone could help me out to solve this problem Thanks Niroshan -- View this message

[R] How to get cov matrix of regression parameters in GEE using 'geese' or 'geeglm''

2012-01-01 Thread Niroshan
Dear R users, I fitted a GEE model using the function 'geese' (or 'geeglm') with user defined correlation matrix. I want to get the var-cov matrix of the regression coefficients. But the output provides only limited information. I would be very much thankful if you could kindly let me know