Re: [R] structural equation models in R

2014-04-06 Thread Patrick Coulombe
Hi Thanoon, Not sure how we can help when you ask such a vague, broad question. But in any case, I would recommend using the package lavaan in R. Look it up: http://lavaan.ugent.be/ Patrick 2014-04-06 6:26 GMT-06:00 thanoon younis thanoon.youni...@gmail.com: hi i need your help to know how

Re: [R] Multilevel Modelling

2014-03-28 Thread Patrick Coulombe
Have you tried running it using lmer() in lme4 instead, see if that helps? Patrick 2014-03-27 6:21 GMT-06:00 Laura Thomas skagandboneg...@hotmail.com: Hi All, I am using R for the purpose of multilevel modelling for the first time. I am trying to examine individuals interpersonal changes in

Re: [R] Problems using lmer {lme4}

2013-05-17 Thread Patrick Coulombe
Hi Andrea, I'm not exactly sure what you're trying to do, but you've included a random effect for a site coefficient that's not even in your list of fixed effects... you're basically allowing the coefficient for site to vary across routes, but you're never including the coefficient in the first

Re: [R] How can I extract part of the data with a selection criterion?

2013-05-09 Thread Patrick Coulombe
Hi, Try ab[a==3,] You're selecting only rows for which a==3 (before the comma), and all columns (empty condition for column index, after the comma) Patrick 2013/5/9 jpm miao miao...@gmail.com: Hi, As an example, how can I get the data such that field a of ab, ab[a], equals 3? I expect

Re: [R] Assigning a variable value based on multiple columns

2013-04-25 Thread Patrick Coulombe
Hi Jason, I think that the easiest for you would be to keep your current elseif statements as is, but change your NA into something else (e.g., -999, or anything else). To do this in one line, you can use the package gdata. In this code, I assume that your data are stored in the variable

Re: [R] Regarding Modeling - Please! QUICK HELP

2013-04-25 Thread Patrick Coulombe
Hi Andrew, I don't know the dataset at all (and you seem to assume that your readers will), but anyway: it looks like you're trying to do an intercept-only model. If that's the case, try: logmod11 - lmer(log(Reaction) ~ 1 + (1|Subject),REML=FALSE) 1 is the intercept, and anything in

Re: [R] creating dummy variables

2013-04-20 Thread Patrick Coulombe
Hello Shyam, if your data is stored in variable dataset, for example, the following code will create the desired dummy-coded variables and attach them to the dataset: ## #init vars SWHE=BARL - vector(length=nrow(dataset)) SWHE[]=BARL[] - 0 #initialize dummy-coded vars with