Re: [R] mcmcsamp shortening variable names; how can i turn this feature off?

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Sat 11 Feb 2006 - 00:20:16 EST

Andrew Gelman <gelman@stat.columbia.edu> writes:

> I have written a function called mcsamp() that is a wrapper that runs
> mcmcsamp() and automatically monitors convergence and structures the
> inferences into vectors and arrays as appropriate.
>
> But I have run into a very little problem, which is that mcmcsamp()
> shortens the variable names. For example:
>
> > set.seed (1)
> > group <- rep (1:5,10)
> > a <- rnorm (5,-3,3)
> > y <- rnorm (50, a[group], 2)
> > fit <- lmer (y ~ 1 + (1 | group))
> > mcmcsamp(fit)
> (Intercept) log(sigma^2) log(grop.(In))
> [1,] -2.771979 0.6909418 1.750876
> attr(,"mcpar")
> [1] 1 1 1
> attr(,"class")
> [1] "mcmc"
>
>
> I want "grop" in the above output to be "group", and I want "(In)" to be
> "(Intercept)". For my purposes (fitting models in general settings) it
> is important to have descriptive variable names, and I gain nothing by
> restricting names to 14 characters.
>
> Is there a way to turn this feature off?
> Thanks.

Looks like they've been run through abbreviate() (which I thought would be called abbr(), but apparently not...)

> abbreviate("Peter Dalgaard",5)

Peter Dalgaard

       "PtrDl"

Unfortunately, the 2 parts have been abbreviated separately, so the long names are lost (in fact never generated). I suppose that it could be possible to hack Matrix:::abbrvNms so that a long version is returned in names(colnames(mcmc.out)). You have the sources...

Given how close even atanh(Sbj.(I).Dys) is to filling up the label field of a Trellis plot, I must say that I think there is a case for abbreviating. Those names easily get *very* long.

-- 
   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Sat Feb 11 00:24:18 2006

This archive was generated by hypermail 2.1.8 : Mon 13 Feb 2006 - 22:41:19 EST