Hi Ben and R experts

Thank you so much Ben. It solved my problem.

The error message that you suggested watch is following:

1: In coxme.varcheck(ncluster, varlist, n, gvars, groups, ... :
Diagonal of variance matrix is not constant

I think this is due to kmat, whose diag (variance ) is assumed to be  
constant but some some of them are not!

diag(kmat)
[1] 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000
[11] 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000
[21] 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250
[31] 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250
[41] 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250
[51] 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250
[61] 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000
[71] 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250
[81] 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250 0.6250
[91] 0.6875 0.6875 0.6875 0.6875 0.6875 0.6875 0.6875 0.6875 0.6875 0.6875

the diagnol of kmat are assumed to be 0.50. I do not know if we can force  
it to be 0.5, someway during calculation of kmat (kinship matrix).

For example kinship coefficient for 21st individual is 0.6250. The 21st  
mother and father are 7 and 8 which are sibs (from parents being 1 and 2).  
This is
is inbreeding situation which is common in animals not in humans. I would  
appreciate your comment if you work with kinship matrix.


Thank you;

Ram H



On Apr 16, 2011 11:08am, Ben Bolker <bbolker@gmail.com> wrote:
> Ram H. Sharma writes:





> > > Dear R experts

> > >

> > > I was using kinship package to fit mixed model with kinship matrix.

> > > The package looks like lme4, but I could find a way to extract p-value

> > > out of it. I need to extract is as I need to analyse large number of

> > > variables (> 10000).

> > >

> > > Please help me:

> > >



> require(kinship)



> ##Generating random example data



> #********************pedigree data*****************************





> id


> dadid
> momid


> ped


> #  
> *****************************kmatrix**************************************



> cfam


> kmat


> #*****************************************x and y variables



> set.seed(3456)



> dat


> snpmat


> names(snpmat)


> yvar
> covtrait


> mydata


> #******************************mixed model in lmekin





> fmod
> varlist=list(kmat))



> ## note warning message ???



> ## $coefficients[2,4] # does not work



> Your best bet in this situation is to look at (1) print.lmekin

> and (2) str(fmod) to see what is present in the object and how

> the package is extracting the information when it prints it.

> This will show you that the information you want (the table

> of parameter estimates and Wald p-values) is contained in

> a list element called "ctable" so fmod$ctable[2,4]

> is what you want.



> I do think it is most helpful when package authors make

> this information accessible: the (or at least a) standard

> convention is to have a summary() method that returns an

> object of class summary.xxx (in this case summary.lmekin)

> which in turn has a coef() method to extract the coefficient

> matrix with standard errors and p-values, so that

> coef(summary(fmod)) would get what you wanted (that is

> not implemented here).





> #*******************************ultimate target: to put in



> >



> nvars
> P
> for (i in seq(nvars)) {

> P[i]
> varlist=list(kmat))$ctable[2,4]

> }



> You might want to watch out for the warning messages: not

> being familar with the package, I don't know what they signify.

> But ignoring warning messages is always dangerous.



> _______________________________________________

> R-sig-mixed-models@r-project.org mailing list

> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



	[[alternative HTML version deleted]]


