Displaying 20 results from an estimated 120 matches similar to: "How to write random effect in MCMCglmm"
2005 Oct 05
0
has_and_belongs_to_many on legacy DB
I am working with mapping ActiveRecord onto a legacy database. All is going
well (using set_table_name, set_primary_key, etc), but I can''t get my
many<=>many relationships to work.
My contrived example of the situation:
Student has_and_belongs_to_many Teachers. This is mapped via table
student2teacher where the foreign keys are studentId and teacherId. The
primary key in Student
2012 Jul 06
3
Tables extraction in R ?
Hi,
I 'm a novice user of R statistics and my hands-on experience with it is
minimal.
I want to create a table for my MBA course assignment that looks like the
ones that SPSS and MS Excel produces ,the data that the table has to include
are the following :
> table(agec)
agec
1 2 3
749 160 32
> x=table(agec)
> x
agec
1 2 3
749 160 32
>
> prop.table(x)
agec
2012 Oct 08
1
Survival prediction
> Dear All,
>
> I have built a survival cox-model, which includes a covariate * time interaction. (non-proportionality detected)
> I am now wondering how could I most easily get survival predictions from my model.
>
> My model was specified:
> coxph(formula = Surv(event_time_mod, event_indicator_mod) ~ Sex +
> ageC + HHcat_alt + Main_Branch + Acute_seizure +
2005 Dec 22
2
bVar slot of lmer objects and standard errors
Hello,
I am looking for a way to obtain standard errors for emprirical Bayes estimates of a model fitted with lmer (like the ones plotted on page 14 of the document available at http://www.eric.ed.gov/ERICDocs/data/ericdocs2/content_storage_01/0000000b/80/2b/b3/94.pdf). Harold Doran mentioned (http://tolstoy.newcastle.edu.au/~rking/R/help/05/08/10638.html) that the posterior modes' variances
2011 Feb 05
1
very basic HLM question
Hi everyone,
I need to get a between-component variance (e.g. random effects Anova),
but using lmer I don't get the same results (variance component) than
using random effects Anova. I am using a database of students, clustered
on schools (there is not the same number of students by school).
According to the ICC1 command, the interclass correlation is .44
> ICC1(anova1)
[1] 0.4414491
2006 Oct 20
1
Translating lme code into lmer was: Mixed effect model in R
This question comes up periodically, probably enough to give it a proper
thread and maybe point to this thread for reference (similar to the
'conservative anova' thread not too long ago).
Moving from lme syntax, which is the function found in the nlme package,
to lmer syntax (found in lme4) is not too difficult. It is probably
useful to first explain what the differences are between the
2006 Mar 29
1
Lmer BLUPS: was(lmer multilevel)
Paul:
I may have found the issue (which is similar to your conclusion). I
checked using egsingle in the mlmRev package as these individuals are
strictly nested in this case:
library(mlmRev)
library(nlme)
fm1 <- lme(math ~ year, random=~1|schoolid/childid, egsingle)
fm2 <- lmer(math ~ year +(1|schoolid:childid) + (1|schoolid), egsingle)
Checking the summary of both models, the output is
2003 Sep 08
0
lmList with NAs
Hello R-Helpers,
I was trying to use the lmList function to get the lmList graphic similar to Pinheiro and Bates (pg 33). I did not have a problem creating the graphic when I used the Orthodont data frame or 2 other data sets when there are no missing values.
My data has missing values. Do I need to remove the missing values before the lmList function will work?
for a small example:
> a
2003 Jun 25
2
NLME Covariates
Dear list
In HLM, one can specify a covariate at one of the "levels". For example, if the data structure are repeated observations nested within students nested within schools, school size might be a covariate that is used at level 3, but not at the other levels. In HLM this is rather easy to do.
However, how can one specify a covariate in R for only one of the levels? I have a
2012 Nov 06
1
Multinomial MCMCglmm
Thanks for your answers Stephen and Ben,
I hope I am posting on the correct list now.
I managed so far to run the multinomial model with random effect with the
following command:
MCMCglmm(fixed=cbind(Apsy,Mygl,Crle,Crru,Miag,empty) ~
habitat:trait,random=~idh(trait):mesh,family="multinomial12",
data=dataA,rcov=~trait:units)
(where multiple responses are different species,
Habitat
2010 Nov 26
0
Question about random interactions in MCMCglmm
Hi,
I've been a bit confused by different wyas we specify random effects
in lmer and MCMCglmm i just want to clear something. When I want to
look for intersexual genetic correlations in the trait, is it
equivalent to treat this trait for opposite sexes as separate traits
and include the term idh(trait):animal - to treating this as a single
trait and fitting idh(sex):animal? Do these two ways
2011 Dec 01
0
MCMCglmm error with multinomial distribution
With binomial/binary responses (0|1) running MCMCglmm with
family="multinomial" terminates with
Error in if (nJ < 1) { : missing value where TRUE/FALSE needed
with family="categorical" there are no errors
I have not looked in the code, do I need format the responses
TRUE/FALSE , or is this just a bug?
--
H?vard Wahl Kongsg?rd
2012 May 03
0
LME4 to MCMCglmm
Hi all,
I am trying to run an lme4 model (logistic regression with mixed effects) in
MCMCglmm but am unsure how to implement it properly.
Currently, my lme4 model formula looks as follows: "outcome ~ (1 + var1 +
var2 | study) + var1 + var2"
In English, this means that I am fitting a random effects model, where the
intercept, var1 and var2 are jointly distributed according to study.
2012 Feb 13
1
MCMCglmm with cross-classified random effects
Dear R-users,
I would like to fit a glmm with cross-classified random effects with
the function MCMCglmm. Something along the lines:
model1<-MCMCglmm(response~pred1, random=~re1+re2, data=data)
where re1 and re2 should be crossed random effects. I was wondering
whether you could tell me specifying cross-classified random effects
in MCMCglmm requires a particular syntax? Are there any
2010 Mar 29
2
mcmcglmm starting value example
Hi R-users:
Can anyone give an example of giving starting values for MCMCglmm?
I can't find any anywhere.
I have 1 random effect (physicians, and there are 50 of them)
and family="ordinal"?
How can I specify starting values for my fixed effects? It doesn't seem to have the option to do so.
Thanks, Ping
2017 Aug 23
0
MCMCglmm issue
When I try to use the following code, I get the error message shown. This
is quite confusing to me, insofar as family is a recognized argument for
MCMCglmm. Can anyone spot an obvious glitch?
model1 <-MCMCglmm(fixed = NoRRVpos ~ Year, random = ~County,
family="zipoisson", data=Rabies_Project_Init)Error in MCMCglmm(fixed =
NoRRVpos ~ Year, random = ~County, family =
2018 May 01
0
[FORGED] Re: Specifying priors in a multi-response MCMCglmm
On 02/05/18 09:53, Michelle Kline wrote:
> Hi Bert,
>
> That was distinctly unhelpful
Not if you actually follow Bert's advice.
> and your outward hostility to a field you
> obviously don't understand reveals a regrettable level of ignorance.
I didn't see any hostility to any field. Bert, like many of us, objects
to people blithely and arrogantly applying possibly
2018 May 03
1
MCMCglmm - metric of the estimates
Hi,
my question is probably amateurish but I can't seem to find the answer
anywhere.
In what metric are the MCMCglmm package's posterior means for family =
"categorical"?
I suppose that they can't be odds ratios and probabilites as my numbers are
outside their bounds. So I'm thinking ? are they just basic regression
coefficients conceptually equal to those obtained by
2012 Feb 08
0
MCMCglmm
Dear Jarrod,
I have a data set where residual have a heavy-tailed distribution with
some extreme residual values and consequently the distribution deviates
from the Gaussian one.
Is it possible to include an skewed-normal density for the residual in
MCMCglmm package?
I have done the analysis of this data with both ASReml & MCMCglmm. The
results are similar and outcome from MCMCglmm
2012 Jun 23
0
Using at.level() with a MCMCglmm zero-inflated poisson model
I have a question for users of MCMCglmm that have experience implementing
the zero-inflated poisson model.
I find that the documentation, and previous questions, do not offer a lot
of clear guidance on specifying and interpreting the zipoisson model. In
particular, I see a lot of zero-inflated poisson examples that use the
at.level(trait, x):variableName syntax.
Specifically, the MCMCglmm