[R] plot in package psych with function error.bars.by

William R Revelle revelle at northwestern.edu
Thu Jun 19 04:07:34 CEST 2014


Tham,
   What you have found is that the cats eyes of the error bars will throw an error if there no variance for a cell (or, just one person in a cell). This I will fix so that it complains but doesn’t quit.

The example you were running was filtering out the subjects less than 10 years old and more than 80.  This was done to avoid the problem you detected.

You can actually draw the plot with error bars and the pch specified as you wanted, if you set eyes=FALSE.  This gives the error bars without the offending cats eyes.

I will have an update on the server in about two days.

Bill

On Jun 16, 2014, at 2:52 AM, Tham Tran <hanhtham.tran at yahoo.com.vn> wrote:

> Hi William,
> 
> I've just updated your latest package "psych_1.4.6.11.zip" from server
> "personality-project/r/src/contrib/". One time the updating process was
> finished, i tried to run based samples code:
> 
> require(psych)
> keys.list=list(Agree=c(-1,2:5),Conscientious=c(6:8,-9,-10),Extraversion=c(-11,-12,13:15),Neuroticism=c(16:20),Openness
> = c(21,-22,23,24,-25))
> keys = make.keys(28,keys.list,item.labels=colnames(bfi))
> scores = scoreItems(keys,bfi,min=1,max=6) 
> error.bars.by(scores$scores,round(bfi$age/10)*10,by.var=TRUE,main="BFI age
> trends",legend=3,labels=colnames(scores$scores),xlab="Age",ylab="Mean item
> score")
> 
> then i had an error following: 
> 
> Erreur dans if (del == 0 && to == 0) return(to) : 
>  valeur manquante là où TRUE / FALSE est requis
> De plus : Messages d'avis :
> 1: In qt(1 - alpha/2, group.stats[[g]]$n - 1) : production de NaN
> 2: In dt(ln, n - 1) : production de NaN
> 3: In qt(alpha/2, n - 1) : production de NaN
> 
> Could you tell me how to fix these issues? May i had a mistake of updating
> your lasted package?
> 
> Sincerly
> Tham
> 
> 
> 
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/plot-in-package-psych-with-function-error-bars-by-tp4691632p4692177.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

William Revelle		           http://personality-project.org/revelle.html
Professor			           http://personality-project.org
Department of Psychology   http://www.wcas.northwestern.edu/psych/
Northwestern University	   http://www.northwestern.edu/
Use R for psychology             http://personality-project.org/r
It is 5 minutes to midnight	   http://www.thebulletin.org



More information about the R-help mailing list