0

Being new to R, and also to this forum, I apologise if I am posting the question in an unclear manner.

I am using lme4 to run linear mixed model. The model itself works, my problem is in plotting its output with plotLMER, since I would need to add the standard error of the mean with the error bars, but cannot find a way to do it. Thus far, I my code is (data is added below):

read.table("data.txt", header=T) -> data
library(lme4)
m1 <- lmer(log(IA_FIRST_RUN_DWELL_TIME) ~ SEMANTIC*SYNTACTIC + (1|SUBJECT) + (1|SENTENCE_ID), data=data);

library(languageR)
plotLMER.fnc(m1, fun=exp, ylab='Dwell time (ms)', pred='SEMANTIC', lwd=3, font= 2, 
         font.lab= 2, xlabs = 2, linecolor = 3:5, 
         intr=list('SYNTACTIC', c('cong','incong'), 'end'),addlines=T) 

The model works and the plot shows fine, but, as mentioned, I would need to add error bars to it - and this is where I got stuck.

So far I wasnt' able to find an answer to this question anywhere, so any help would be very much appreciated. Thanks! Cata

Example of the data:
SUBJECT SENTENCE_ID IA_FIRST_RUN_DWELL_TIME SEMANTIC SYNTACTIC
s1 1101 334 cong cong
s3 1101 755 cong cong
s5 1101 237 cong cong
s10 2105 127 cong incong
s11 2105 298 cong incong
s13 2105 190 cong incong
s23 3115 238 incong cong
s25 3115 154 incong cong
s2 3116 472 incong cong
s11 4116 259 incong incong
s13 4116 401 incong incong
s14 4116 729 incong incong

John Conde
  • 217,595
  • 99
  • 455
  • 496
Cata
  • 1
  • 1
  • Please also include the data so that we can reproduce what you're seeing. Note that `;` is not necessary in R. – Roman Luštrik May 19 '17 at 08:02
  • Thanks for your response and advice! I added an example of the data (in a slightly clumsy way, I'm afraid), since the whole dataset is huge. Hope this could be enough. Thanks again! – Cata May 19 '17 at 09:24
  • [Here are a few tips](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) on how to ask a well formed question. Post enough data to make it instructive (i.e. it demonstrates the problem). Don't forget to include all the code necessary to reproduce what you're after. – Roman Luštrik May 19 '17 at 10:41
  • Thanks. Hope it's now ok. – Cata May 20 '17 at 11:30

0 Answers0