Dear R Support Team,

I have tried to compare the log-likelihoods of the two models, with and
without the fixed effect which I want to test significance for. Nevertheless.
it does not work for lmekin objects. Could you provide me some solution how
to do that.
Moreover please indicate some method for multiple comparisons of groups
within particular fixed effect. When I tried to obtain df value for the
model, the result was always NULL.
The last question is how to extract variation components and to calculate
heritability?

My model:
m1=lmekin(kgm~s1+rs+w+d+(1|id), data=milk,varlist=list(kmat))
,where:
s1 and rs are categorical factors
w and d are continuous variables

> summary(m1)
             Length Class  Mode
coefficients   2    -none- list
var          576    -none- numeric
vcoef          1    -none- list
residuals    424    -none- numeric
method         1    -none- character
loglik         1    -none- numeric
sigma          1    -none- numeric
n              1    -none- numeric
call           4    -none- call
rvar           1    -none- numeric
iter           2    -none- numeric
> m1
Linear mixed-effects kinship model fit by maximum likelihood
  Data: milk
  Log-likelihood = -3604.361
  n= 424


Model:  kgm ~ s1 + rs + w + d + (1 | id)
Fixed coefficients
                   Value    Std Error     z       p
(Intercept) -7920.701534 3023.8600619 -2.62 8.8e-03
s1CT           76.794638  170.4547258  0.45 6.5e-01
s1TT          770.554009  428.2979895  1.80 7.2e-02
rs2003s2     1335.176474 1344.4342656  0.99 3.2e-01
rs2004s1     1870.773274  861.5747018  2.17 3.0e-02
rs2004s2     1784.307434 1366.0593031  1.31 1.9e-01
rs2005s1     2849.522645  926.4414789  3.08 2.1e-03
rs2005s2     2486.210241  846.6835494  2.94 3.3e-03
rs2006s1     1756.016058  735.8492313  2.39 1.7e-02
rs2006s2     2216.941969  769.2182425  2.88 4.0e-03
rs2007s1     2796.197396  774.6566677  3.61 3.1e-04
rs2007s2     3124.945897  769.0728464  4.06 4.8e-05
rs2008s1     2887.273027  759.1794318  3.80 1.4e-04
rs2008s2     3652.569548  733.7944105  4.98 6.4e-07
rs2009s1     3767.072605  739.4121617  5.09 3.5e-07
rs2009s2     4214.124725  743.3092905  5.67 1.4e-08
rs2010s1     3531.512166  740.0453808  4.77 1.8e-06
rs2010s2     4032.536562  734.9962561  5.49 4.1e-08
rs2011s1     4167.056720  746.4233233  5.58 2.4e-08
rs2011s2     4617.445325  735.2761752  6.28 3.4e-10
rs2012s1     3291.394032  873.2073594  3.77 1.6e-04
rs2012s2     3807.023242  768.5026529  4.95 7.3e-07
w               2.300196    0.6510945  3.53 4.1e-04
d              41.339062    9.9779674  4.14 3.4e-05

Random effects
 Group Variable Std Dev     Variance
 id    Vmat.1      1210.785 1465999.783
Residual error= 864.8264
> m1$df
NULL



"Hi,

When I use the kinship package I fit two models, with and without the
fixed effect you want to test. The compare the log-likelihoods of the
two models, twice the difference in log-likelihood between models should
be apprixmately chi-square with df equal to the difference in number of
parameters in the two models.

So using your example:

aa<-lmekin(dta1[,j] ~ dta1[,k] + g1:g2:g3:g4,data = dta1, random =
~1|geno, varlist = list(K), subset = Year==i)

aa2<-lmekin(dta1[,j] ~ g1:g2:g3:g4,data = dta1, random = ~1|geno,
varlist = list(K), subset = Year==i)

X2<-2*(logLik(aa)-logLik(aa2))
df<-aa$df-aa2$df
p<-1-pchisq(X2,df)

would give you a chi-square value and the associated degrees of freedom.
The p-value of the effect can then be calculated using pchisq.

-Pelle

	[[alternative HTML version deleted]]

