1 Nov 2005 04:58

### Re: [R] nls() fit to Kahnemann/ Tversky function

```Note that a simple logistic with a saturation level of 1 seems
to do quite well.  Below we have removed the last point in order
to avoid the singularity:

x <- p.kum[-10]
y <- felt.prob.kum[-10]
plot(log(y/(1-y)) ~ x)
abline(lm(log(y/(1-y)) ~ x), col = "red")

On 10/31/05, Mark Hempelmann <neo27 <at> t-online.de> wrote:
> Dear WizaRds,
>
>     I would like to fit a curve to ten points with nls() for one
> unknown parameter gamma in the Kahnemann/ Tversky function, but somehow
> it won't work and I am unable to locate my mistake.
>
> p.kum <- seq(0.1,1, by=0.1)
> felt.prob.kum <- c(0.16, 0.23, 0.36, 0.49, 0.61, 0.71, 0.85, 0.89, 0.95,
> 1) ## how to find a function that fits these points nicely?
> plot(p.kum, felt.prob.kum) ## looks a little like an "S"
>
> gamma <- rep(0.5, 10)
> nls.dataframe <- data.frame(p.kum,felt.prob.kum, gamma)
>
> nls.kurve <- nls( formula = felt.prob.kum ~
> p.kum^gamma/(p.kum^gamma+(1-p.kum)^gamma)^(1/gamma), data=nls.dataframe,
> start=c(gamma=gamma), algorithm="plinear" )
>
> summary(nls.kurve)
>
```

1 Nov 2005 07:30

### [R] balloonplot/ package gplots/ getting rid of the grid

```Background:
OS: Linux Mandrake 10.1
release: R 2.1.1
editor: GNU Emacs 21.3.2
front-end: ESS 5.2.3
---------------------------------

Colleagues

Does anyone know how to get rid of the grid in balloonplot? I have read the
help file.

tt <- seq(1,10)
tt2 <- tt+20
tt3 <-tt*1.5
balloonplot(tt, tt2, tt3)

I have a matrix of 278 * 278 and the grid makes the plot opaque.

Thanks,

Sam
----
Sam McClatchie,
Biological oceanography
South Australian Aquatic Sciences Centre
PO Box 120, Henley Beach 5022
email <mcclatchie.sam <at> saugov.sa.gov.au>
Cellular: 0431 304 497
```

1 Nov 2005 08:02

### Re: [R] balloonplot/ package gplots/ getting rid of the grid

```Get the gplots:::balloonplot.default source and remove
the two abline lines.

On 11/1/05, McClatchie, Sam (PIRSA-SARDI)
<mcclatchie.sam <at> saugov.sa.gov.au> wrote:
> Background:
> OS: Linux Mandrake 10.1
> release: R 2.1.1
> editor: GNU Emacs 21.3.2
> front-end: ESS 5.2.3
> ---------------------------------
>
> Colleagues
>
> Does anyone know how to get rid of the grid in balloonplot? I have read the
> help file.
>
> tt <- seq(1,10)
> tt2 <- tt+20
> tt3 <-tt*1.5
> balloonplot(tt, tt2, tt3)
>
> I have a matrix of 278 * 278 and the grid makes the plot opaque.
>
> Thanks,
>
> Sam
> ----
> Sam McClatchie,
> Biological oceanography
```

1 Nov 2005 09:36

### Re: [R] How can I test temporal autocorrelation of binary data?

```
Depending on what you are really want to infer from the autocorrelations,
you want to consider the runs-test, too.

HTH,
Bernhard

If you mean you want to test that there is no autocorrelation,
then there is some information on using the Ljung-Box test on
such data in the working paper 'Robustness of the Ljung-Box
test and its rank equivalent' on the Burns Statistics website.

The executive summary is that the test seems to do okay as
long as one of the values is not too dominant.  What 'dominant'
means depends on the length of the series.

If some one has a better answer, I'm keen to hear it.

Patrick Burns
patrick <at> burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")

>Hi,
>
>I have a binary (o/1 - coded) data set and want to test it's
autocorrelation
```

1 Nov 2005 10:43

### Re: [R] Help with try or tryCatch

```On Mon, 31 Oct 2005, McGehee, Robert wrote:

> It sounds like you want `try` with the argument `silent = TRUE`. This
> will allow you to keep running your program without errors. If you want
> to check if the line had an error, you can error control by seeing if
> the class of the resulting object is "try-error". For example, let's say
> I wanted to make an error-proof `plus` function, such that trying "a" +
> 2 would result in NA instead of an error.
>
> newPlus <- function(x, y) {
> 	answer <- try(x + y, silent = TRUE)
> }
>

This approach worked. I had to define a test function of this sort outside
of the loops and then call it within the loops with appropriate parameter
values. Thanks for the assistance.

David Scott

-------------------------------------------------------
David Scott	Department of Statistics, Tamaki Campus
The University of Auckland, PB 92019
Auckland	NEW ZEALAND
Phone: +64 9 373 7599 ext 86830		Fax: +64 9 373 7000
Email:	d.scott <at> auckland.ac.nz

```

1 Nov 2005 11:03

### [R] R2WinBUGS: Comparison to WinBUGS

```Hi R-Users!

I know I posted the question before (see archives) but I have not been able to
find the mistake. Again using R2WinBUGS and WinBUGS does not yield the same
result (although to my opinion the commands are the same). The variance of the
parameters is much bigger and the parameter estimates are a bit different, too.
If anybody has the time and interest to get the files and data and see if he/she
has the same problems, I would be happy to provide these (and to discuss it
further). It seems though that it must be my mistake SOMEWHERE because nobody
else reported any problems yet...

Thanks.

--

--

Birmannsgasse 10A
CH-4055 Basel
Switzerland
Phone: +41 78 797 6065
Email: h.brunschwig <at> utoronto.ca

______________________________________________
R-help <at> stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help

```
1 Nov 2005 22:20

### Re: [R] line vector plots

```Eduardo Klein wrote:

> Hi Jim,
>
> Thanks for the tip, but I really need the same polar chart but over a
line no in a circle. I didn't find it on the plotrix package.
>
Hmmm, are you looking for something like this?

feather.plot<-function(x,y,xpos,yref=0,use.arrows=FALSE,...) {
if(missing(xpos)) xpos<-1:length(x)
xlim<-range(x+xpos)
ylim<-range(y)
plot(0,xlim=xlim,ylim=ylim,type="n")
abline(h=yref)
if(use.arrows) arrows(xpos,yref,xpos+x,y,length=0.1,...)
else segments(xpos,yref,xpos+x,y,...)
}

where x and y are the components of the vectors and xpos is the
positions on the time line? If so, I'll add that to plotrix - looks useful.

Jim

______________________________________________
R-help <at> stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help

```

1 Nov 2005 12:32

### [R] standard errors in summary.lm

```Dear R users,

If I have an aov object, how are the standard errors of the estimates in
summary.lm calculated?

Using treatment contrasts, I would like to use the estimated differences
in mean values ("intercepts") to calculate the mean values per factor
level, and for these mean values I´f like to use the model output to
calculate the standard errors.

Regards,
Christoph.

______________________________________________
R-help <at> stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help

```
1 Nov 2005 12:37

### [R] How to change label size in a plot

```Dear all,

I have created a plot like this:

hc<-hclust(dist(matrix)^2,"cen")
memb<-cutree(hc,k=10)
plot(hc,col="black")

This prints out a dendrogram with labels, but the text of the labels is
large, so they overlap and are unreadable. How can I decrease the size of
the lable text on a dendrogram so that it does not overlap and is therefore

I know the question is similar to that posted by Michael Schmitt on 19 March
2005, but as far as I can see, the question was not answered.

Many Thanks,

Fiona
____________________________________________
Fíona Mc Cahey

Department of Chemistry
University of Cambridge
Cambridge, CB2 1EW

______________________________________________
R-help <at> stat.math.ethz.ch mailing list
```

1 Nov 2005 13:18

### [R] Doubly Non-Central F-Distribution

```Hello All,

Has anyone written a function for the distribution function of a
*doubly* non-central F-distribution? I looked through the archives, but
didn't find anything. Thanks!

Wolfgang

______________________________________________
R-help <at> stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help