Re: [R] Histogram ploting

2004-04-19 Thread Martin Maechler
 Mateusz == Mateusz £oskot [EMAIL PROTECTED]
 on Sun, 18 Apr 2004 17:13:34 +0200 writes:

Mateusz Hi Christophe, On 4/18/2004 3:17 PM, Christophe
Mateusz Pallier wrote:
 The 'hist' function works on the raw data.  In your data
 set example, you have already computed the number of data
 points in each bin.

Mateusz Yes, you are right. I evidently misunderstood the
Mateusz hist function usage described in manuals.

 What you really want is probably a barplot of N You could
 display your data:
 
 plot(Class,N,'h')

Mateusz Yes, that's right.  Thank you very much.

well, I think you did have real histogram data,
and in teaching about graphics I do emphasize the difference
between a barplot {in R: plot of table(); space between bars} 
and a histogram {continuous x; no space between bars}.

In this case, I'd rather construct an object of class
'histogram' and plot() it, i.e., call the plot.histogram method:

(mids - seq(12.5, 47.5, by = 5))
N - c(3,10, 12,8, 7,3, 4,2)
## Construct breaks from  mids  in general
## (here, simply br - seq(10,50,by=5) is easier)
dx - mean(diff(mids))
br - (mids[-1] + mids[-length(mids)])/2
(br - c(br[1] - dx, br, br[length(br)] + dx))

his - list(breaks=br, counts=N, mids = mids)
class(his) - histogram
plot(his, main = Histogram of my stuff)


Regards,
Martin

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] outliers using Random Forest

2004-04-19 Thread Edgar Acuna
Dear Andy,
Thanks for your quick answer. I increased the number of trees and the
outlyingness measure got more stable. But still I do not know if I am
working with the raw measure or with the normalized measure mentioned
in the Breiman's Wald lecture. The normalized measure nout is

nout=(nout-med)/mean(abs(nout-med))
where med is the median of the class containing the case correponding
to nout.

Best regards
Edgar Acuna

On Sun, 18 Apr 2004, Liaw, Andy wrote:

 The thing to do is probably:

 1. Use fairly large number of trees (e.g., 1000).
 2. Run a few times and average the results.

 The reason for the instability is sort of two fold:

 1. The random forest algorithm itself is based on randomization.  That's why
 it's probably a good idea to have 500-1000 trees to get more stable
 proximity measures (of which the outlying measures are based on).

 2. If you are running randomForest in unsupervised mode (i.e., not giving it
 the class labels), then the program treats the data as class 1, creates a
 synthetic class 2, and run the classification algorithm to get the
 proximity measures.  You probably need to run the algorithm a few times so
 that the result will be based on several simulated data, instead of just
 one.

 HTH,
 Andy

  From: Edgar Acuna
 
  Hello,
  Does anybody know if the outscale option of randomForest yields the
  standarized version of the outlier measure for each case? or
  the results
  are only the raw values. Also I have notice that this measure presents
  very high variability. I mean if I repeat the experiment I am
  getting very
  different values for this measure and it is hard to flag the outliers.
  This does not happen with two other criteria than I am using: LOF and
  Bay's Orca. I am getting several cases that can be considered
  as outliers
  with both approaches.
   I run my experiments  using Bupa and Diabetes available at
  UCI Machine database repository.
 
  Thanks in advance for any response.
 
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide!
  http://www.R-project.org/posting-guide.html
 
 


 --
 Notice:  This e-mail message, together with any attachments, contains
 information of Merck  Co., Inc. (One Merck Drive, Whitehouse Station, New
 Jersey, USA 08889), and/or its affiliates (which may be known outside the
 United States as Merck Frosst, Merck Sharp  Dohme or MSD and in Japan as
 Banyu) that may be confidential, proprietary copyrighted and/or legally
 privileged. It is intended solely for the use of the individual or entity
 named on this message.  If you are not the intended recipient, and have
 received this message in error, please notify us immediately by reply e-mail
 and then delete it from your system.
 --


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Turning windows screen buffering on and off

2004-04-19 Thread Philippe Grosjean
The buffered output is a nice thing, and if the user want to use it, then
fine! However, it should be nice to know if it is set ON or OFF, and to
temporarily change it for some outputs in R scripts. I think this is the
primary request. Then, your request appears to me as a secondary one: to set
buffered output ON or OFF at statup of Rgui (by defining it in the
preference panel). Personnally, I would really like to have both.
Best,

Philippe Grosjean

...°}))
 ) ) ) ) )
( ( ( ( (   Prof. Philippe Grosjean
\  ___   )
 \/ECO\ (   Numerical Ecology of Aquatic Systems
 /\___/  )  Mons-Hainaut University, Pentagone
/ ___  /(   8, Av. du Champ de Mars, 7000 Mons, Belgium
 /NUM\/  )
 \___/\ (   phone: + 32.65.37.34.97, fax: + 32.65.37.33.12
   \ )  email: [EMAIL PROTECTED]
 ) ) ) ) )  SciViews project coordinator (http://www.sciviews.org)
( ( ( ( (
...

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
[EMAIL PROTECTED]
Sent: Friday, 16 April, 2004 18:09
To: [EMAIL PROTECTED]
Subject: RE: [R] Turning windows screen buffering on and off


Well, I too would like to be able to set buffered output to false for Rgui
Windows without user intervention.  Maybe it could be set via the Edit -
Gui Preferences so that it can be saved and set at startup.  The GUI
Preferences are part of the interface and not the standard language
definition right?...so that seems to be a good spot to set something like
that.

Benjamin Stabler
Transportation Planning Analysis Unit
Oregon Department of Transportation
555 13th Street NE, Suite 2
Salem, OR 97301  Ph: 503-986-4104

-

Message: 75
Date: Fri, 16 Apr 2004 08:59:43 +0100 (BST)
From: Prof Brian Ripley [EMAIL PROTECTED]
Subject: RE: [R] Turning windows screen buffering on and off
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Message-ID: [EMAIL PROTECTED]
Content-Type: TEXT/PLAIN; charset=US-ASCII

No, and options() really is part of the R/S language not the interface.

See the rw-FAQ Q6.3 for how to manage the buffering more effectively.
(Hint: you need to put calls to flush.console() in your code.)


On Fri, 16 Apr 2004 [EMAIL PROTECTED] wrote:

 I meant via a function or something like:

 options( buffered.output = FALSE)

 Sorry, I should have made that clearer.

 Cheers
 Toby



 -Original Message-
 From: Roger D. Peng [mailto:[EMAIL PROTECTED]
 Sent: Friday, April 16, 2004 1:11 PM
 To: Patterson, Toby (Marine, Hobart)
 Cc: [EMAIL PROTECTED]
 Subject: Re: [R] Turning windows screen buffering on and off

 Ctrl-W.

 -roger

 [EMAIL PROTECTED] wrote:
  All,
 
  Does anyone know if there is an option I can set to turn
 screen-buffered
  output on and off with the win32 rgui? (Apart from the point and click
  method).
 
  I am running some simulations where it is useful to watch output but
 it
  gets mildly tiresome having to manually switch things on and off via
 the
  gui.
 
  Thanks
 
  Toby.
 
 
 version
 
   _
  platform i386-pc-mingw32
  arch i386
  os   mingw32
  system   i386, mingw32
  status
  major1
  minor8.1
  year 2003
  month11
  day  21
  language R
 
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html
 

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html



--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] SE for combined data

2004-04-19 Thread AJ Smit
Dear all

I have just had the question from a colleague. I know that it is not directly related to R (I will probably use R to do the analysis), but I hope someone can give us some insight:

Thanks,
AJ Smit


I sampled populations of a seaweed in the intertidal in order to estimate
the standing biomass of that seaweed at that site.
Due to clumped distribution patterns, I chose a stratified sampling system,
as follows. In each of three subjectively defined biomass classes (low,
medium and high biomass density), four quadrats (usually) were haphazardly
placed, and the biomass in those quadrats harvested. This provided an
estimate of the biomass density present in that biomass density class. The
area of ground covered by that biomass density class was also estimated,
and, by combining the estimated biomass density and the area covered by that
biomass density class, the total biomass in that biomass density class was
estimated. When the estimated biomass in the three biomass density classes
was combined, I had a figure for the standing biomass for that site..
So, for each biomass density class, I have a number of biomass density
estimates (usually, but not always, four), and an estimate of the area
covered by that class.
I repeated this at a number of sites. Biomass density classes were not
necessarily the same between sites.
Given that I can calculate measures of variation for each biomass density
class, is there a way to combine these data, presumably weighted by the area
covered by each biomass density class, and calculate the standard error for
the final biomass estimate at each site?

Thanks
Neil
--
~~~
Dr Albertus J. Smit
Department of Botany
University of Cape Town
Private Bag Rondebosch
7700
Cape Town
SOUTH AFRICA

Tel. +27 21 689 3032
Fax  +27 21 650 4041
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Box-Ljung p-value - Test for Independence

2004-04-19 Thread Pfaff, Bernhard
 
 1) A small p-value is evidence that there is dependence.
 So you want to see large p-values.  But a large p-value
 is not really evidence of independence -- merely a lack
 of evidence of dependence.

Hello Aroon,

additionally to the points voiced by Patrick, only if your series at hand is
normally distributed you can infer from uncorrelatedness (Ljung-Box test) to
independence. These two are equivalent in the case of normally distributed
random variables. Uncorrelated rv are not necessarily independent, whereas
the opposite is true. Hence, you want to utilise Jarque-Bera-test, or some
test for normality, too.

HTH,
Bernhard 


 
 You might be able to get a hint of the power of your test
 (which is what you really care about) from the working
 paper about Ljung-Box on the Burns Statistics website.
 
 2) The statistic is really an average of the lags up to the
 stated lag.  So if the dependence is all at lag 5, tests with
 lags below 5 have no power, the lag 5 test has maximum
 power, and the power decreases as the lag of the test
 increases above 5.
 
 Patrick Burns
 
 Burns Statistics
 [EMAIL PROTECTED]
 +44 (0)20 8525 0696
 http://www.burns-stat.com
 (home of S Poetry and A Guide for the Unwilling S User)
 
 Aroon Nataraj wrote:
 
  Hi all
  I'm using the Box-Ljung test (from within R) to test if a 
 time-series 
  in independently distributed.
 
  2 questions:
  1) p-value returned by Box-Ljung:
  IF I want to test if the time-series is independant at say 0.05 
  sig-level (it means that prob of erroneously accepting that the 
  time-series is independent is 0.05 right?)
  -- then do I consider time-series as independant when
   -- p-value (from Box-Ljung)  0.05
   OR
-- p-value  0.05
  Or should i be using (0.95) instead of (0.05) for this case. I'm 
  confused about this (this is a goodness-of-fit test?).
 
  2) Box-Ljung takes a lag argument, say lag=k.
  Does it check all lags upto k
  OR
  Does it check only AT k (i.e acf val is small at only k?)
 
  thank you in advance. I apologize if the questions are very basic.
 
  Aroon
 
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! 
  http://www.R-project.org/posting-guide.html
 
 
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html



The information contained herein is confidential and is inte...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] solve 2 var problem

2004-04-19 Thread Ramzi TEMANNI
Hi

I'm getting started with R and i have difficulties finding how to solve this
problem in R :

 

Find x,y satisfying 

Trace(K)  C, 

K positive where ( K=x.A+y.B), 

[A,B,K square Matrix in  R(n x n), x,y in R]

 

Thanks in advance,

Ramzi


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] trend turning points

2004-04-19 Thread Ajay Shah
   does anybody know of a nice test to detect trend turning points in
   time series? Possibly with reference?
  
  You can look at the function breakpoints() in the package strucchange
  and the function segmented() in the package segmented which do
  segmentation of (generalized) linear regression models. The former
  tries to fit fully segmented regression models, the latter broken line
  trends.  References are given on the respective help pages.
  
  A suitable test for a change in trend in linear regression models is
  the OLS-based CUSUM test with a Cramer-von Mises functional of Kraemer
   Ploberger (1996, JoE) which is available via efp() in strucchange
  and associated methods.

I have seen strucchange with great interest but somehow the
combination of the R and the statistics knowledge that is required to
access it feels like a bottleneck :-) Could someone perhaps write a
simple R program which illustrates the facilities and usage?

-- 
Ajay Shah   Consultant
[EMAIL PROTECTED]  Department of Economic Affairs
http://www.mayin.org/ajayshah   Ministry of Finance, New Delhi

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Non-Linear Regression (Cobb-Douglas and C.E.S)

2004-04-19 Thread Pfaff, Bernhard
 Dear all,
 
 For estimating Cobb-Douglad production Function [ Y = ALPHA * 
 (L^(BETA1)) * 
 (K^(BETA2))  ], i want to use nls function (without 
 linearizing it). But 
 how can i get initial values?
 
 
   options(prompt= R  )
   R Y - c(59.6, 63.9, 73.5, 75.6, 77.3, 82.8, 83.6, 84.9, 
 90.3, 80.5, 
 73.5, 60.3, 58.2, 64.4, 75.4, 85, 92.7, 85.4, 92.3, 101.2, 
 113.3, 107.8, 
 105.2, 107.1, 108.8, 131.4, 130.9, 134.7, 129.1, 147.8, 152.1, 154.3, 
 159.9) # production
   R L - c(39.4, 41.4, 43.9, 43.3, 44.5, 45.8, 45.9, 46.4, 
 47.6, 45.5, 
 42.6, 39.3, 39.6, 42.7, 44.2, 47.1, 48.2, 46.4, 47.8, 49.6, 
 54.1, 59.1, 
 64.9, 66, 64.4, 58.9, 59.3, 60.2, 58.7, 60, 63.8, 64.9, 66) # 
 employment
   R K - c(236.2, 240.2, 248.9, 254.5, 264.1, 273.9, 282.6, 
 290.2, 299.4, 
 303.3, 303.4, 297.1, 290.1, 285.4, 287.8, 292.1, 300.3, 301.4, 305.6, 
 313.3, 327.4, 339, 347.1, 353.5, 354.1, 359.4, 359.3, 365.2, 
 363.2, 373.7, 
 386, 396.5, 408) # capital
   R klein - cbind(Y,L,K)
   R klein.data-data.frame(klein)
   R coef(lm(log(Y)~log(L)+log(K)))
 # i used these linearized model's estimated parameters as 
 initial values
 (Intercept)  log(L)  log(K)
   -3.6529493   1.0376775   0.7187662
   R nls(Y~ALPHA * (L^(BETA1)) * (K^(BETA2)), 
 data=klein.data, start = 
 c(ALPHA=-3.6529493,BETA1=1.0376775,BETA2=0.7187662), trace = T)
 6852786785 :  -3.6529493  1.0376775  0.7187662
 1515217 :  -0.02903916  1.04258165  0.71279051
 467521.8 :  -0.02987718  1.67381193 -0.05609925
 346945.7 :   -0.5570735  10.2050667 -10.2087997
 Error in numericDeriv(form[[3]], names(ind), env) :
  Missing value or an Infinity produced when 
 evaluating the model
 
 
 1. What went wrong? I think the initial values are not good 
 enough: How can 
 i make a grid search?
 
 2. How can i estimate C.E.S Production Function [  Y = GAMA * 
 ((DELTA*K^(-BETA)) + ((1-DELTA)*L^(-BETA)))^(-PHI/BETA)  ] 
 using the same 
 data? How to get the initial value?
 

Dear James, Wettenhall,

as far as the CES production function is concerned, you might want to
utilise the Kmenta approximation. The following link elucidates this
approach and other feasible estimation techniques.

http://www.cu.lu/crea/projets/mod-L/prod.pdf


HTH,
Bernhard

 N.B.: The data file is available at 
http://www.angelfire.com/ab5/get5/klein.txt

Any response / help / comment / suggestion / idea / web-link / replies will 
be greatly appreciated.

Thanks in advance for your time.

___

Mohammad Ehsanul Karim [EMAIL PROTECTED]
Institute of Statistical Research and Training
University of Dhaka, Dhaka- 1000, Bangladesh

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html



The information contained herein is confidential and is inte...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] trend turning points

2004-04-19 Thread Achim Zeileis
On Mon, 19 Apr 2004 14:27:00 +0530 Ajay Shah wrote:

does anybody know of a nice test to detect trend turning points
   in time series? Possibly with reference?
   
   You can look at the function breakpoints() in the package
   strucchange and the function segmented() in the package segmented
   which do segmentation of (generalized) linear regression models.
   The former tries to fit fully segmented regression models, the
   latter broken line trends.  References are given on the respective
   help pages.
   
   A suitable test for a change in trend in linear regression models
   is the OLS-based CUSUM test with a Cramer-von Mises functional of
   Kraemer Ploberger (1996, JoE) which is available via efp() in
   strucchange and associated methods.
 
 I have seen strucchange with great interest but somehow the
 combination of the R and the statistics knowledge that is required to
 access it feels like a bottleneck :-) Could someone perhaps write a
 simple R program which illustrates the facilities and usage?

The package has an accompanying vignette which explains the ideas behind
it and how to use its inference functions. The breakpoints() facilities
are also documented in a paper by Zeileis, Kleiber, Kraemer, Hornik
(2003, CSDA).

A mini-example would be:

## load package and data
R data(Nile)
R library(strucchange)

## fit, visualize and test OLS-based CUSUM test
## with a Cramer-von Mises functional
R ocus - efp(Nile ~ 1, type = OLS-CUSUM)
R plot(ocus, functional = meanL2)
R sctest(ocus, functional = meanL2)

## estimate breakpoints
R bp - breakpoints(Nile ~ 1)
R plot(bp)
R summary(bp)

hth,
Z

 -- 
 Ajay Shah   Consultant
 [EMAIL PROTECTED]  Department of Economic Affairs
 http://www.mayin.org/ajayshah   Ministry of Finance, New Delhi


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] How can I get the length of returning array in c++ calling R code?

2004-04-19 Thread Song Baiyi
Hello,

Now I would like to call R code from c++ and R code return a dynamic 
length of integer array.

I used

length(eval(VECTOR_ELT(expression,1),R_GlobalEnv)) 

to return the length of result array in c++, but it did not work.

What can I do to get the length?

Thank you very much!

Baiyi Song

CEI
Dortmund Univercity
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] looking up value from a pair of vectors

2004-04-19 Thread Stefann Jonsso
Hello  R community.

Can anyone inform me how to solve this short problem? I have a dataset that 
I want to recode according to a  pair of short numerical vectors. Here is a 
short example:

# Start R code

map1 - matrix(ncol=3, byrow=T,c( 197796,label0,1,
197797,label1,2,
197798,label2,3,
197799,label3,4,
197800,label4,5))
xx - as.integer(map1[,1])
lab - map1[,2]
yy - as.integer(map1[,3]
data1a - c(197797, 197798, 197799, 197800,
  197797, 197797, 197797, 197797)


data1b - some.function.or.combinaion.of.few(data1a,xx,yy)

# desired result for data1b

data1b
2 3 4 5 2 2 2 2
# End R code

data1a is always longer than xx.
all numerical entries in data1a are members of xx. (in the more general 
problem, the the number 197796 may or may not be included in data1a)
value in data1a that are not members of xx would produce a ”Na”



Thanks in advance for all replies,
Stefan Jonsson
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] looking up value from a pair of vectors

2004-04-19 Thread Prof Brian Ripley
 match(data1a, xx)
[1] 2 3 4 5 2 2 2 2

On Mon, 19 Apr 2004, Stefann Jonsso wrote:

 Hello  R community.
 
 Can anyone inform me how to solve this short problem? I have a dataset that 
 I want to recode according to a  pair of short numerical vectors. Here is a 
 short example:
 
 
 # Start R code
 
 map1 - matrix(ncol=3, byrow=T,c( 197796,label0,1,
 197797,label1,2,
 197798,label2,3,
 197799,label3,4,
 197800,label4,5))
 
 xx - as.integer(map1[,1])
 lab - map1[,2]
 yy - as.integer(map1[,3]
 
 
 data1a - c(197797, 197798, 197799, 197800,
197797, 197797, 197797, 197797)
 
 
 
 data1b - some.function.or.combinaion.of.few(data1a,xx,yy)
 
 # desired result for data1b
 
 data1b
 2 3 4 5 2 2 2 2
 
 # End R code
 
 
 data1a is always longer than xx.
 all numerical entries in data1a are members of xx. (in the more general 
 problem, the the number 197796 may or may not be included in data1a)
 value in data1a that are not members of xx would produce a ”Na”

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] looking up value from a pair of vectors

2004-04-19 Thread Adaikalavan Ramasamy
 (m - match(data1a, map1[ ,1])) 
[1] 2 3 4 5 2 2 2 2

 map1[m ,2] # to return labels 
[1] label1 label2 label3 label4 label1 label1 label1
label1


On Mon, 2004-04-19 at 11:34, Stefann Jonsso wrote:
 Hello  R community.
 
 Can anyone inform me how to solve this short problem? I have a dataset that 
 I want to recode according to a  pair of short numerical vectors. Here is a 
 short example:
 
 
 # Start R code
 
 map1 - matrix(ncol=3, byrow=T,c( 197796,label0,1,
 197797,label1,2,
 197798,label2,3,
 197799,label3,4,
 197800,label4,5))
 
 xx - as.integer(map1[,1])
 lab - map1[,2]
 yy - as.integer(map1[,3]
 
 
 data1a - c(197797, 197798, 197799, 197800,
197797, 197797, 197797, 197797)
 
 
 
 data1b - some.function.or.combinaion.of.few(data1a,xx,yy)
 
 # desired result for data1b
 
 data1b
 2 3 4 5 2 2 2 2
 
 # End R code
 
 
 data1a is always longer than xx.
 all numerical entries in data1a are members of xx. (in the more general 
 problem, the the number 197796 may or may not be included in data1a)
 value in data1a that are not members of xx would produce a Na
 
 
 
 Thanks in advance for all replies,
 Stefan Jonsson
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] New unique name

2004-04-19 Thread Ted Harding
On 19-Apr-04 Erich Neuwirth wrote:
 In some languages there is a function
 gensym()
 which returns a new unique name (in the current environment).
 This is quite helpful when one has to do temporary assignments.
 I could not find such a function in R.
 Is there one?

If you are running R on a Unix-like system (such as Linux) then
you could use the mktemp function (see 'man mktemp').

In R,

  system(mktemp -u tmpXX)

will return a unique identifier (and will not, because of the
-u flag, create the file).

The identifier will be of the form (e.g.) tmpdPT6Nw, i.e. with
the 6 X's replaced by random characters.

A bit sledgehammer for nut, but as least it meets your needs!

(Strictly speaking, uniqueness in repeated use is not absolutely
guaranteed with the -u option, since strict uniqueness depends
on 'mktemp' checking for an existing file with the same name.
However, since there are some (26+26+10)^6  10^10 combinations
to randomly choose from, you should be pretty safe.)

Best wishes,
Ted.



E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 167 1972
Date: 19-Apr-04   Time: 12:00:35
-- XFMail --

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R analog of Matlab eigs function

2004-04-19 Thread Balaji Srinivasan
Hi, 

I was wondering if anyone knew of an implementation of a function similar to
eigs in Matlab (full description here:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/eigs.html). 

This function differs from the standard eigen in that it computes a *few*
eigenvectors for cases in which your matrix is very large and/or you don't
need all the eigenvectors. (It uses the Arnoldi-Lanczos iterative method, as
implemented in C in ARPACK). For example, this is the case for classical
multidimensional scaling when you only need the first 2 eigenvectors. 

I feel almost certain that something like this is probably somewhere in R,
possibly even as a (hidden) subroutine within a function like cmdscale.
However, I didn't turn anything up after quite a bit of googling and
help.search(). Would appreciate any help with this. 

Thanks in advance, 

Balaji Srinivasan

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] One inflated Poisson or Negative Binomal regression

2004-04-19 Thread Brian
Dr. Flom,
I was searching the web for any examples of one-inflated negative binomial regression, 
and ran across your post.  Fittingly, I am working on the analysis of data from the 
NIDA Cooperative Agreement where I had the pleasure of working with Sherry Deren and 
other folks at NDRI.  NBR does a poor job of modeling number of sex partners.  (I am 
using Stata.)  Did you have any luck modeling a one-inflated negative binomial?

Brian Weir
Program Design  Evaluation Services
Multnomah County Health Department

[EMAIL PROTECTED]
[EMAIL PROTECTED]

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] New unique name

2004-04-19 Thread Barry Rowlingson
(Ted Harding) wrote:

A bit sledgehammer for nut, but as least it meets your needs!
 You could even use uuidgen to create a universally unique ID, and then 
use make.names to R-ify it:

 make.names(system(uuidgen,intern=T))
[1] aa33d26c.88a5.4eab.94ba.5073c4718ffe
 make.names(system(uuidgen,intern=T))
[1] d5aea7a0.81e9.4690.8d48.d74fd2b50a83
 make.names(system(uuidgen,intern=T))
[1] X2570d3e0.6b07.42be.a9c6.3701ac82b4f0
 Of course the requirement was to make an object with a name that 
didn't already exist, and there's no guarantee that you haven't already 
created an object called X2570d3e0.6b07.42be.a9c6.3701ac82b4f0 for 
some reason.

 So that's no good.

 How about getting an alphabetically-sorted list of all the current 
objects and then using the last one augmented with something:

makeUnique - function(){
 allObjects=sort(ls(pos=seq(1:length(search()
 paste(allObjects[length(allObjects)],-temp,sep='')
}
 I'm sure someone can come up with a bigger sledgehammer, or a reason 
why this wont always be unique. What's the longest name of an object in 
R? That'll break it... Pah.

Baz

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] New unique name

2004-04-19 Thread Prof Brian D Ripley
On Mon, 19 Apr 2004, Barry Rowlingson wrote:

 (Ted Harding) wrote:

  A bit sledgehammer for nut, but as least it meets your needs!

   You could even use uuidgen to create a universally unique ID, and then
 use make.names to R-ify it:

   make.names(system(uuidgen,intern=T))
 [1] aa33d26c.88a5.4eab.94ba.5073c4718ffe
   make.names(system(uuidgen,intern=T))
 [1] d5aea7a0.81e9.4690.8d48.d74fd2b50a83
   make.names(system(uuidgen,intern=T))
 [1] X2570d3e0.6b07.42be.a9c6.3701ac82b4f0

   Of course the requirement was to make an object with a name that
 didn't already exist, and there's no guarantee that you haven't already
 created an object called X2570d3e0.6b07.42be.a9c6.3701ac82b4f0 for
 some reason.

   So that's no good.

   How about getting an alphabetically-sorted list of all the current
 objects and then using the last one augmented with something:

 makeUnique - function(){
   allObjects=sort(ls(pos=seq(1:length(search()
   paste(allObjects[length(allObjects)],-temp,sep='')
 }

   I'm sure someone can come up with a bigger sledgehammer, or a reason
 why this wont always be unique. What's the longest name of an object in
 R? That'll break it... Pah.

There is more to the environment than the search path, which is what makes
this tricky.  I suspect Erich really only wanted to avoid objects in the
current frame (which is not on the search path except for interactive use
of R), but he didn't tell us too precisely.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] geoR - help for bayesian modelling

2004-04-19 Thread Monica Palaseanu-Lovejoy
Hi,

I am trying to do a bayesian prediction for soil pollution data above 
a certain threshold, using geoR. 

Everything is working fine until i am doing the krig.bayes ( I am 
using as a guide the geoR tutorial from the web page 
http://www.est.ufpr.br/geoR/geoRdoc/geoRintro.html#starting). I 
tried to do the prediction on a grid 67 by 113 cells and my 
computer is freezing to death. At larger numbers of cells it tells me 
after a while that it reaches the max. memory of 511 Mb. My 
computer has only 512 Mb of RAM. What RAM capacity should i 
look for to do a 150 x 250 cell grid??? (I tried the modelling on a 1 
Gb RAM computer and it didn't work either). I am interested to do a 
modelling where my resolution is 5 m x 5 m (150 x 250 grid cell).

If i want to do the prediction on my initial data locations (well, 
actually the prediction points are shifted 1 m in X and respectively 
Y direction, so the raw data coordinates don't coincide with the 
prediction coordinates) i am getting the following error using the 
command:

zn.bayes - krige.bayes(zn.gdata, loc = xy, model = 
model.control(cov.model = “exponential”, lambda = 0), prior = 
prior.control(phi.prior =”exponential”, phi = 89.1894), 
output=output.control(n.predictive=2, mean.var = TRUE, quantile = 
c(0.025,0.25, 0.5, 0.75, 0.975), threshold = c(300)))

Error in cond.sim(env.loc = base.env, env.iter = iter.env, 
loc.coincide = get(loc.coincide,  : 
chol: matrix not pos def, diag[13]= -1.279220e-018

I will really appreciate any suggestion you may have.

Thank you so much,

Monica

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] How to write an S4 method for sum or a Summary generic

2004-04-19 Thread Swinton, Jonathan
If I have a class Foo, then i can write an S3 method for sum for it:

setClass(Foo,representation(a=integer));aFoo=new(Foo,a=c(1:3,NA))
sum.Foo - function(x,na.rm){print(x);print(na.rm);sum([EMAIL PROTECTED],na.rm=na.rm)}
sum(aFoo)

But how do I write an S4 method for this? All my attempts to do so have
foundered. For example
setMethod(sum,signature(Foo,logical),
function(x,na.rm){print(x);print(na.rm);sum([EMAIL PROTECTED],na.rm=na.rm)}
creates a method which seems to despatch on na.rm=Foo:
 getMethods(sum)
na.rm = ANY:
function (..., na.rm = FALSE) 
.Internal(sum(..., na.rm = na.rm))

na.rm = Foo:
function (..., na.rm = FALSE) 
{
.local - function (x, na.rm) 
{
print(x)
print(na.rm)
sum([EMAIL PROTECTED], na.rm = na.rm)
}
.local(..., na.rm = na.rm)
}

na.rm = missing:
function (..., na.rm = FALSE) 
.Internal(sum(..., na.rm = na.rm))
##:(inherited from na.rm = ANY)

Pages 350-352 of the Green book discuss at some length how to write a
generic function for Summary group generics which uses tail recursion to
allow the correct method to be called on each member of a ... argument list.
But it gives no examples of what individual method functions need to look
like. Any ideas or a place to look for working code?

Jonathan Swinton, Statistical Scientist, Computational Biology, Pathway
Analysis, Global Sciences and Information, AstraZeneca.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] New unique name and fixing getAnywhere()

2004-04-19 Thread Jens Oehlschlägel

# what about

gensym - function(root=GeneratedSymbolname, pool=c(letters, LETTERS,
0:1), n=16, sep=_)
{
  todo - TRUE
  while (todo){
symbolname - paste(root, paste(sample(pool, n, TRUE), collapse=),
sep=sep)
todo - length(getAnywhere(symbolname)$objs)
  }
  symbolname
}

# but this requires a slightly changed version of getAnywhere()
# which currently finds: getAnywhere(find)
# but does not find: symbolname - find; getAnywhere(symbolname)
# (BTW current getAnywhere() has returnvalue$objs whereas the documentation
says returnvalue$funs)
# the following patch avoids this problem and is more aligned with get()

getAnywhere - function(x)
{
stopifnot(is.character(x))
objs - list()
where - character(0)
visible - logical(0)
if (length(pos - find(x, numeric = TRUE))) {
objs - lapply(pos, function(pos, x) get(x, pos = pos),
x = x)
where - names(pos)
visible - rep.int(TRUE, length(pos))
}
if (length(grep(., x, fixed = TRUE))) {
np - length(parts - strsplit(x, ., fixed = TRUE)[[1]])
for (i in 2:np) {
gen - paste(parts[1:(i - 1)], collapse = .)
cl - paste(parts[i:np], collapse = .)
if (!is.null(f - getS3method(gen, cl, TRUE))) {
ev - topenv(environment(f), NULL)
nmev - if (isNamespace(ev))
  getNamespaceName(ev)
else NULL
objs - c(objs, f)
msg - paste(registered S3 method for, gen)
if (!is.null(nmev))
  msg - paste(msg, from namespace, nmev)
where - c(where, msg)
visible - c(visible, FALSE)
}
}
}
for (i in loadedNamespaces()) {
ns - asNamespace(i)
if (exists(x, envir = ns, inherits = FALSE)) {
f - get(x, envir = ns, inherits = FALSE)
objs - c(objs, f)
where - c(where, paste(namespace, i, sep = :))
visible - c(visible, FALSE)
}
}
ln - length(objs)
dups - rep.int(FALSE, ln)
objs2 - lapply(objs, function(x) {
if (is.function(x))
environment(x) - NULL
x
})
if (ln  1)
for (i in 2:ln) for (j in 1:(i - 1)) if (identical(objs2[[i]],
objs2[[j]])) {
dups[i] - TRUE
break
}
res - list(name = x, objs = objs, where = where, visible = visible,
dups = dups)
class(res) - getAnywhere
res
}



-- 

Ab sofort DSL-Tarif ohne Grundgebühr: http://www.gmx.net/info

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] outliers using Random Forest

2004-04-19 Thread Liaw, Andy
 From: Edgar Acuna [mailto:[EMAIL PROTECTED] 
 
 Dear Andy,
 Thanks for your quick answer. I increased the number of trees and the
 outlyingness measure got more stable. But still I do not know if I am
 working with the raw measure or with the normalized measure mentioned
 in the Breiman's Wald lecture. The normalized measure nout is
 
 nout=(nout-med)/mean(abs(nout-med))
 where med is the median of the class containing the case correponding
 to nout.

Looking at the Fortran subroutine `locateout' in rfsub.f, yes, they are
normalized.  (That part of the code is not changed from Breiman  Cutler's
original.)

Andy

 
 Best regards
 Edgar Acuna
 
 On Sun, 18 Apr 2004, Liaw, Andy wrote:
 
  The thing to do is probably:
 
  1. Use fairly large number of trees (e.g., 1000).
  2. Run a few times and average the results.
 
  The reason for the instability is sort of two fold:
 
  1. The random forest algorithm itself is based on 
 randomization.  That's why
  it's probably a good idea to have 500-1000 trees to get more stable
  proximity measures (of which the outlying measures are based on).
 
  2. If you are running randomForest in unsupervised mode 
 (i.e., not giving it
  the class labels), then the program treats the data as 
 class 1, creates a
  synthetic class 2, and run the classification algorithm to get the
  proximity measures.  You probably need to run the algorithm 
 a few times so
  that the result will be based on several simulated data, 
 instead of just
  one.
 
  HTH,
  Andy
 
   From: Edgar Acuna
  
   Hello,
   Does anybody know if the outscale option of randomForest 
 yields the
   standarized version of the outlier measure for each case? or
   the results
   are only the raw values. Also I have notice that this 
 measure presents
   very high variability. I mean if I repeat the experiment I am
   getting very
   different values for this measure and it is hard to flag 
 the outliers.
   This does not happen with two other criteria than I am 
 using: LOF and
   Bay's Orca. I am getting several cases that can be considered
   as outliers
   with both approaches.
I run my experiments  using Bupa and Diabetes available at
   UCI Machine database repository.
  
   Thanks in advance for any response.
  
   __
   [EMAIL PROTECTED] mailing list
   https://www.stat.math.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide!
   http://www.R-project.org/posting-guide.html
  
  
 
 
  
 --
 
  Notice:  This e-mail message, together with any 
 attachments, contains
  information of Merck  Co., Inc. (One Merck Drive, 
 Whitehouse Station, New
  Jersey, USA 08889), and/or its affiliates (which may be 
 known outside the
  United States as Merck Frosst, Merck Sharp  Dohme or MSD 
 and in Japan as
  Banyu) that may be confidential, proprietary copyrighted 
 and/or legally
  privileged. It is intended solely for the use of the 
 individual or entity
  named on this message.  If you are not the intended 
 recipient, and have
  received this message in error, please notify us 
 immediately by reply e-mail
  and then delete it from your system.
  
 --
 
 
 
 
 


--
Notice:  This e-mail message, together with any attachments,...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] looking for something like ave I can pass non numeric to

2004-04-19 Thread John Christie
Hi,
	I have been trying to calculate summary error and coding statistics on 
a by subject basis and seem to be writing a lot of code to do a simple 
thing.  I won't go into my messy version.  What I am asking is if 
anyone knows of a single command that could take the following data and 
get error rates over a given vector.

Given data from ss with,,,

subja   rt  code
1   1   200 good
1   1   321 good
1   2   457 good
1   2   384 bad
2   1   228 good
2   1   343 bad

I would like to do a calculation something like ave returns.  An 
artificial example that does not work where I have passed the code 
field to ave is below.

ss$FAcount- ave(ss$code, ss$subj, function(x) 
length(x[x==good])/length(x))

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R-1.9.0: make error on slackware-current!

2004-04-19 Thread Prof Brian Ripley
I have been able to reproduce this.  It appears that _some_ XFree 4.4.0 
Linux installations need 

#include stdio.h

so please add that before the X11/X.h call in src/modules/X11/dataentry.c

It seems nothing to do with _Xconst.


On Sun, 18 Apr 2004, Prof Brian Ripley wrote:

 On Sun, 18 Apr 2004, Timothy Tatar wrote:
 
  It appears that the #If NeedFunctionPrototypes compiler directive has been
  removed from Xlib.h and Xutil.h in Xfree86 4.4. All the prototypes
  containing the offending _Xconst are now being processed. R 1.8.1, which
  built successfully under XFree86 4.3, fails under XFree86 4.4 with the same
  error messages.
 
 Yes, we do know.  However, 1.9.0 _has_ been built against XFree 4.4, and
 also XFree 8.3 with NeedFunctionPrototypes defined to be 1.  _Xconst 
 should be defined, so the problem seems to be with `slackware-current' 
 (whatever that is) rather than XFree 4.4.  Does adding
 
 #ifndef _Xconst
 #define _Xconst const
 #endif /* _Xconst */
 
 help?  (That's inside #if NeedFunctionPrototypes in the headers I have.)
 
 
 

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R-1.9.0: make error on slackware-current!

2004-04-19 Thread Prof Brian Ripley
Sorry, a time skew caused a problem here:

removing the line 

#define NeedFunctionPrototypes 0

is also needed.

On Mon, 19 Apr 2004, Prof Brian Ripley wrote:

 I have been able to reproduce this.  It appears that _some_ XFree 4.4.0 
 Linux installations need 
 
 #include stdio.h
 
 so please add that before the X11/X.h call in src/modules/X11/dataentry.c
 
 It seems nothing to do with _Xconst.
 
 
 On Sun, 18 Apr 2004, Prof Brian Ripley wrote:
 
  On Sun, 18 Apr 2004, Timothy Tatar wrote:
  
   It appears that the #If NeedFunctionPrototypes compiler directive has been
   removed from Xlib.h and Xutil.h in Xfree86 4.4. All the prototypes
   containing the offending _Xconst are now being processed. R 1.8.1, which
   built successfully under XFree86 4.3, fails under XFree86 4.4 with the same
   error messages.
  
  Yes, we do know.  However, 1.9.0 _has_ been built against XFree 4.4, and
  also XFree 8.3 with NeedFunctionPrototypes defined to be 1.  _Xconst 
  should be defined, so the problem seems to be with `slackware-current' 
  (whatever that is) rather than XFree 4.4.  Does adding
  
  #ifndef _Xconst
  #define _Xconst const
  #endif /* _Xconst */
  
  help?  (That's inside #if NeedFunctionPrototypes in the headers I have.)
  
  
  
 
 

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] solve 2 var problem

2004-04-19 Thread Liaw, Andy
trace(K) is just sum(diag(K)).  Assuming by `.' you mean multiplication
(I'll use `*' below),

trace(x*A + y*B) = x*trace(A) + y*trace(B)

Let a = trace(A) = sum(diag(A)) and b = trace(B) = sum(diag(B)).  You are
then looking for (x, y) that satisfy

a*x + b*y  C

which ought to be trivial.  I don't think you need R for that.

Andy

 From: Ramzi TEMANNI
 
 Hi
 
 I'm getting started with R and i have difficulties finding 
 how to solve this
 problem in R :
 
  
 
 Find x,y satisfying 
 
 Trace(K)  C, 
 
 K positive where ( K=x.A+y.B), 
 
 [A,B,K square Matrix in  R(n x n), x,y in R]
 
  
 
 Thanks in advance,
 
 Ramzi
 
 
   [[alternative HTML version deleted]]
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] histogram y-scaling

2004-04-19 Thread Randy Zelick
Hello all,

Relative to WinXP  R1.8

I have two histograms to plot, and for comparison purposes I want them to
have the same Y-scaling. I tried to find the size of the bin with the
maximum count before generating the histogram, but this did not work (see
below). What is a better way?

par(mfrow=c(2,1)) # set up for plotting in 2 rows and 1 column

x1-seq(-0.5,58.5,1) # make a range of x values for histogram

I thought the following lines would allow me to capture the results of the
hist function and determine the max bin count for scaling *before* making
the plot, but R cleverly saw around my method and plots it anyway. With
this code I get two plots.

q=hist(mt1,x1)   # stick results in a variable... alas also plots
cts=q$counts # get the bin counts
mct1=max(cts)# how many values in the bin with the most values
hist(mt1,x1) # generate histogram plot

# go on with histogram #2...


Thanks,

=Randy=

R. Zelick   email: [EMAIL PROTECTED]
Department of Biology   voice: 503-725-3086
Portland State University   fax:   503-725-3888

mailing:
P.O. Box 751
Portland, OR 97207

shipping:
1719 SW 10th Ave, Room 246
Portland, OR 97201

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] histogram y-scaling

2004-04-19 Thread Prof Brian Ripley
?hist reveals argument plot=TRUE, so try plot=FALSE.

On Mon, 19 Apr 2004, Randy Zelick wrote:

 Hello all,
 
 Relative to WinXP  R1.8

No such thing.  There is R 1.8.0 and R 1.8.1 but not R 1.8.

 I have two histograms to plot, and for comparison purposes I want them to
 have the same Y-scaling. I tried to find the size of the bin with the
 maximum count before generating the histogram, but this did not work (see
 below). What is a better way?
 
 par(mfrow=c(2,1)) # set up for plotting in 2 rows and 1 column
 
 x1-seq(-0.5,58.5,1) # make a range of x values for histogram
 
 I thought the following lines would allow me to capture the results of the
 hist function and determine the max bin count for scaling *before* making
 the plot, but R cleverly saw around my method and plots it anyway. With
 this code I get two plots.
 
 q=hist(mt1,x1)   # stick results in a variable... alas also plots
 cts=q$counts # get the bin counts
 mct1=max(cts)# how many values in the bin with the most values
 hist(mt1,x1) # generate histogram plot
 
 # go on with histogram #2...

Something like
q1 - hist(mt1, x1, plot = FALSE)
q2 - hist(mt2, x2, plot = FALSE)
mctl - max(q1$counts, q2$counts)
plot(q1, ylim=c(0, mctl))
plot(q2,  ylim=c(0, mctl))


-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] New unique name

2004-04-19 Thread Thomas Lumley
On Mon, 19 Apr 2004, Erich Neuwirth wrote:

 Since I have not been precise enough, let me explain in more detail.
 I am executing some R code in the COM server.
 For making function calls with parameters existing as ranges in Excel,
 I need to assign values for the arguments of the function call to
 temporary R variables.
 This is the only way of transferring large matrices quickly from Excel
 to R.
 Then, I construct a string which is the function call to be executed.
 The string contains the names of the newly created R variables
 for the function arguments.
 This string then is sent to R and executed as a command.

I used the following for local variables in a macro

gensym-function(base=.v.,envir=parent.frame()){
   repeat{
nm-paste(base,paste(sample(letters,7,replace=TRUE),
collapse=),sep=.)
if (!exists(nm,envir=envir))
break
}
as.name(nm)
}


You wouldn't need the as.name() conversion, since you want a string.

A sufficiently clever person could come up with code that this could
conflict with (eg, if your code relied on the non-existence of
.v..agdefge), but in normal circumstances it should be fine.

-thomas

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Turning windows screen buffering on and off

2004-04-19 Thread Duncan Murdoch
On Mon, 19 Apr 2004 10:05:48 +0200, Philippe Grosjean
[EMAIL PROTECTED] wrote :

The buffered output is a nice thing, and if the user want to use it, then
fine! However, it should be nice to know if it is set ON or OFF, and to
temporarily change it for some outputs in R scripts. I think this is the
primary request. Then, your request appears to me as a secondary one: to set
buffered output ON or OFF at statup of Rgui (by defining it in the
preference panel). Personnally, I would really like to have both.

In the long term, I'd like it if all of Rgui could be moved to a
package.  From most users' points of view things wouldn't change much,
but it would mean it was more practical for someone like you to write
your own front-end, either by modifying the standard one or by
starting from scratch.

Duncan Murdoch

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R-estimators

2004-04-19 Thread Paolo Radaelli
Dear all,
could you please suggest me the package I have to install in order to use ranks 
statistics in regression models (R-Estimators, wilcoxon scores ...)
Thanks in advance

Paolo Radaelli
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] New unique name

2004-04-19 Thread Duncan Murdoch
I think the function below will tell you all the names that are in
scope at the point where it is called.  You can then make up something
that's not in the list.

Duncan Murdoch

all.names - function() {
env - new.env(parent=parent.frame())
result - ls(env=env)
while (!is.null(env)) {
env - parent.env(env)
result - c(result, ls(env=env))
}
sort(unique(result))
}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Menu addditions to Rcmdr v0.9-6

2004-04-19 Thread White, Charles E WRAIR-Wash DC
1) In general, I would appreciate help in adding functions to the Rcmdr
menu system. I've been able to modify the menus themselves and source test
code but I can't get R functions to execute from the menu. My latest proof
of concept code follows:
 
Three lines added to Rcmdr-menus.txt:
menujunkMenutopMenu 
itemjunkMenucommand Print stuff...  function()
stuff ()
itemtopMenu cascade JunkjunkMenu

 
stuff.R:
stuff -function(){
c(This is stuff to print...)
}
 
2) A file called compareModels.demo is mentioned in the documentation
but I haven't been able to find it in the Windows library downloaded from
CRAN. Where should I look?
 
Thanks!
 
Chuck
 
Charles E. White, Senior Biostatistician, MS
Walter Reed Army Institute of Research
503 Robert Grant Ave., Room 1w102
Silver Spring, MD 20910-1557
301 319-9781
Personal/Professional Site:
http://users.starpower.net/cwhite571/professional/ 
 

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] New unique name

2004-04-19 Thread A.J. Rossini

One possibility would be the Ruuid library in BioConductor.  I'm not
sure if the uuid library  is available (or compilable) under MS
Windows, though.   I'll be checking in a bit (weeks) if no one else
does.


Erich Neuwirth [EMAIL PROTECTED] writes:

 In some languages there is a function
 gensym()
 which returns a new unique name (in the current environment).
 This is quite helpful when one has to do temporary assignments.
 I could not find such a function in R.
 Is there one?


 -- 
 Erich Neuwirth, Computer Supported Didactics Working Group
 Visit our SunSITE at http://sunsite.univie.ac.at
 Phone: +43-1-4277-38624 Fax: +43-1-4277-9386

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


-- 
[EMAIL PROTECTED]http://www.analytics.washington.edu/ 
Biomedical and Health Informatics   University of Washington
Biostatistics, SCHARP/HVTN  Fred Hutchinson Cancer Research Center
UW (Tu/Th/F): 206-616-7630 FAX=206-543-3461 | Voicemail is unreliable
FHCRC  (M/W): 206-667-7025 FAX=206-667-4812 | use Email

CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] classification and association rules in R

2004-04-19 Thread Rong-En Fan
hello,

  I am looking for a classification or/and association rules in R.
However, after searching in CRAN, nothing found. Is anyone know
if they are available in R?

By the way, I heard that there are some people developing a better
search interface for R (or CRAN?). Where are the related information
I can get?

Thanks.

Regards,
Rong-En Fan

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Turning windows screen buffering on and off

2004-04-19 Thread Philippe Grosjean
Duncan Murdoch wrote:
In the long term, I'd like it if all of Rgui could be moved to a
package.  From most users' points of view things wouldn't change much,
but it would mean it was more practical for someone like you to write
your own front-end, either by modifying the standard one or by
starting from scratch.

I totally agree. Recent developments in SciViews (which will be publicly
released in May) focus on GUI extentions *for* Rgui, not *in replacement* of
it as it was the case for SciViews Insider. I have difficulties with
specific aspects like buffered output, whose state is hard to know from R
code... This would be a lot more easier if all Rgui extensions could be
accessed through R code. A dedicated package is an excellent idea.

OK, that said, I go back to my work, because I still have a lot to finish
for UseR! conference...
Best regards,

Philippe Grosjean

...?}))
 ) ) ) ) )
( ( ( ( (   Prof. Philippe Grosjean
\  ___   )
 \/ECO\ (   Numerical Ecology of Aquatic Systems
 /\___/  )  Mons-Hainaut University, Pentagone
/ ___  /(   8, Av. du Champ de Mars, 7000 Mons, Belgium
 /NUM\/  )
 \___/\ (   phone: + 32.65.37.34.97, fax: + 32.65.37.33.12
   \ )  email: [EMAIL PROTECTED]
 ) ) ) ) )  SciViews project coordinator (http://www.sciviews.org)
( ( ( ( (
...

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] using subscripts in a plot title with 2 lines

2004-04-19 Thread Rajarshi Guha
Hi,
  I'm making a plot in which the title takes up two lines. The title
contains a subscript but when I look at the plot it does'nt seem tocome
out properly. The code I'm using is:

   xtxt = expression(paste('Observed -log( ', IC[50], ' )'))
   ytxt = expression(paste('Predicted -log( ', IC[50], ' )'))
   mtxt = expression(paste('Plot of Observed vs. Predicted -log(',
IC[50], ') Values for the PDGFR\nDataset'))

   plot(tset$V2, tset$V3, xlim = c(-2,2), ylim = c(-2,2),
pch = 19, col = blue, 
main=mtxt,
xlab = xtxt,
ylab = ytxt)

Removing the IC[50] term makes it come out OK. 
Is there any way to get around this?

Thanks,

---
Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
---
Does Ramanujan know Polish?
-- E.B. Ross

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] How to write an S4 method for sum or a Summary generic

2004-04-19 Thread Douglas Bates
Swinton, Jonathan [EMAIL PROTECTED] writes:

 If I have a class Foo, then i can write an S3 method for sum for it:
 
 setClass(Foo,representation(a=integer));aFoo=new(Foo,a=c(1:3,NA))
 sum.Foo - function(x,na.rm){print(x);print(na.rm);sum([EMAIL 
 PROTECTED],na.rm=na.rm)}
 sum(aFoo)
 
 But how do I write an S4 method for this? All my attempts to do so have
 foundered. For example
 setMethod(sum,signature(Foo,logical),

 function(x,na.rm){print(x);print(na.rm);sum([EMAIL PROTECTED],na.rm=na.rm)}
 creates a method which seems to despatch on na.rm=Foo:

There is no x argument in the generic so you can't dispatch on it.

 sum
function (..., na.rm = FALSE) 
.Internal(sum(..., na.rm = na.rm))

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] survival analysis question

2004-04-19 Thread Phguardiol
Dear R users,
I have survival estimates for 2 groups according to a factorial covariate 
(covar=1 or 2) and I d like to only plot the difference in term of survival 
between these 2 groups over time with 95%CI. Could someone send me a short script 
to do that since I m not an old R programmer ?
thanks
Philippe 

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] One inflated Poisson or Negative Binomal regression

2004-04-19 Thread Paul Johnson
Dear Peter:

I notice there is a R code for a Zero-inflated Poisson/NB process on the 
Stanford Political Science Computational Lab (Prof. Simon Jackman) web 
page.  If I were wanting to do  a one-inflated model, I would start with 
that because, at least to my eye, it is very easy to  follow.  Mind you, 
I did not try this myself, but I bet you could make it go.  In the file 
zeroinfl.r, look at the function:

zeroinflNegBin - function(parms){

it is pretty clear you'd have to supply a probability model for the 
outcomes valued 1 and then fit them into the overall likelihood.

pj

http://pscl.stanford.edu/content.html
Peter Flom wrote:
Hello

I am interested in Poisson or (ideally) Negative Binomial regression
with an inflated number of 1  responses
I have seen JK Lindsey's fmr function in the gnlm library, which fits
zero inflated Poisson (ZIP) or zero inflated negative binomial
regression, but the help file states that for ' Poisson or related
distributions  the mixture involves the zero category'.
I had thought of perhaps subtracting 1 from all the counts and then
fitting the ZIP or ZINB models, and then adding 1, but am not sure if
this is legitimate, or if there is some better method.
Contextual details:
The dependent variable is number of primary sexual partners in the last
year.  The independent variables include a) Being married or in a
committed relationship  b) using hard drugs  c) sex  d) age
N is c. 500

Not surprisingly, there are a large number of 1 responses, especially
for those who are married or in a relationship.  More surprisingly, the
mean number of partners is the same (1.05 vs. 1.02) for people in and
not in relationships, but the variances are very different, mostly
because those in a relationhsip are much more likely to say exactly 1.
Thanks in advance

Peter

Peter L. Flom, PhD
Assistant Director, Statistics and Data Analysis Core
Center for Drug Use and HIV Research
 

--
Paul E. Johnson   email: [EMAIL PROTECTED]
Dept. of Political Sciencehttp://lark.cc.ku.edu/~pauljohn
1541 Lilac Lane, Rm 504  
University of Kansas  Office: (785) 864-9086
Lawrence, Kansas 66044-3177   FAX: (785) 864-5700

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Unexpected behaviour of identical

2004-04-19 Thread Peter Dalgaard
Swinton, Jonathan [EMAIL PROTECTED] writes:

  # works as expected
  ac - c('A','B');
  identical(ac,ac[1:2])
 [1] TRUE
  
  #but
  af - factor(ac)
  identical(af,af[1:2])
 [1] FALSE
 
 Any opinions?

Hmm, surprising indeed. The proximate cause would seem to be that

 names(attributes(af))
[1] levels class
 names(attributes(af[1:2]))
[1] class  levels

-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] question about linear models.

2004-04-19 Thread ivan . borozan
hi there,

i have the following table with two factors A, B each respectively with 3 and 4
levels (unbalanced design)   

S1
 samples A B
1  1.3398553 0 0
2  0.8455924 0 0
3  1.0290893 0 0
4  1.2720512 0 0
5  1.2071754 0 0
6  1.1859539 0 0
7  2.7399659 2 3
8  1.2476911 2 3
9  2.6389479 2 2
10 1.6914068 1 2
11 2.2260561 2 1
12 1.2955187 1 1
13 1.6526140 1 3
14 2.3159151 2 3
15 2.3905009 1 2
16 2.9520105 2 2
17 1.9478868 1 1
18 1.9936118 1 1
19 1.3775338 1 3
20 1.9638190 2 2
21 1.4697860 1 2
22 2.2028858 2 3
23 2.4024771 2 1
24 1.9935864 1 1


i fit two different models

fit1-aov(samples~A + B,data=S1,contrasts = list(A = contr.treatment, B =
contr.treatment))
fit2-aov(samples~A,data=S1,contrasts = list(A = contr.treatment))
fit3-aov(samples~B,data=S1,contrasts = list(B = contr.treatment))


and using 

anova(fit1,fit2)
Analysis of Variance Table

Model 1: samples ~ A + B
Model 2: samples ~ A
  Res.Df  RSS Df Sum of Sq  F Pr(F)
1 19  2.74820   
2 21  3.14667 -2  -0.39847 1.3774 0.2763

i get B as not significant and


anova(fit1,fit3)

Analysis of Variance Table

Model 1: samples ~ A + B
Model 2: samples ~ B
  Res.Df RSS Df Sum of Sq  F   Pr(F)   
1 19  2.7482
2 20  4.2391 -1   -1.4909 10.308 0.004604 **

A as significant.



however if i do

anova(fit3)

Analysis of Variance Table

Response: samples
  Df Sum Sq Mean Sq F value   Pr(F)   
B  3 3.7241  1.2414  5.8567 0.004854 **
Residuals 20 4.2391  0.2120


i get B as significant and

anova(fit2)

Analysis of Variance Table

Response: samples
  Df Sum Sq Mean Sq F valuePr(F)
A  2 4.8165  2.4083  16.072 5.835e-05 ***
Residuals 21 3.1467  0.1498 

A as significant.




Should i conclude that A is significant and B is not or rather that both factors
are significant ?


all the best

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] using subscripts in a plot title with 2 lines

2004-04-19 Thread Liaw, Andy
If I understood your problem correctly, one ugly way of getting around this
is to use call mtext() twice to put the two lines in the title area, using
the line argument to mtext to control the location of the lines.  E.g.,
something like:

plot(1, main=)
mtext(expression(IC[50]), line=3, side=3, cex=1.2)
mtext(of My Data, line=1.5, side=3, cex=1.2)

HTH,
Andy

 From: Rajarshi Guha
 
 Hi,
   I'm making a plot in which the title takes up two lines. The title
 contains a subscript but when I look at the plot it does'nt 
 seem tocome
 out properly. The code I'm using is:
 
xtxt = expression(paste('Observed -log( ', IC[50], ' )'))
ytxt = expression(paste('Predicted -log( ', IC[50], ' )'))
mtxt = expression(paste('Plot of Observed vs. Predicted -log(',
 IC[50], ') Values for the PDGFR\nDataset'))
 
plot(tset$V2, tset$V3, xlim = c(-2,2), ylim = c(-2,2),
 pch = 19, col = blue, 
 main=mtxt,
 xlab = xtxt,
 ylab = ytxt)
 
 Removing the IC[50] term makes it come out OK. 
 Is there any way to get around this?
 
 Thanks,
 
 ---
 Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net
 GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
 ---
 Does Ramanujan know Polish?
 -- E.B. Ross
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 
 


--
Notice:  This e-mail message, together with any attachments,...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] [R-pkgs] New package: mcgibbsit, an MCMC run length diagnostic

2004-04-19 Thread Warnes, Gregory R

Package: mcgibbsit
Title: Warnes and Raftery's MCGibbsit MCMC diagnostic 
Version: 1.0
Author: Gregory R. Warnes [EMAIL PROTECTED]
Description: 
  mcgibbsit provides an implementation of Warnes  Raftery's MCGibbsit
  run-length diagnostic for a set of (not-necessarily independent) MCMC
  sampers.  It combines the estimate error-bounding approach of Raftery
  and Lewis with evaulate between verses within chain approach
  of Gelman and Rubin.
Maintainer: Gregory R. Warnes [EMAIL PROTECTED]
License: GPL
Depends: coda

References:

Warnes GR. The Normal Kernel Coupler: An adaptive Markov Chain Monte Carlo
method for efficiently sampling from multi-modal distributions
http://www.analytics.washington.edu/statcomp/projects/mcmc/nkc/, Ph.D.
thesis, Department of Biostatistics, University of Washington,
http://www.biostat.washington.edu/ October 2000.   (See Chapter 3, Using
the Normal Kernel Coupler)


Gregory R. Warnes
Manager, Non-Clinical Statistics
Pfizer Global Research and Development
Tel: 860-715-3536



LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}

___
R-packages mailing list
[EMAIL PROTECTED]
https://www.stat.math.ethz.ch/mailman/listinfo/r-packages

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] axis label character bolder

2004-04-19 Thread array chip
Hi, how can I make the character label of the axes of
a plot darker (bolder), but not in a larger size?

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] axis label character bolder

2004-04-19 Thread Chuck Cleland
  If you simply want a bold font, have you tried setting 
font.axis and/or font.lab in par()?  For example,

par(font.axis=2, font.lab=2)
plot(rnorm(10))
  That gives me bold fonts for both components.

 version
 _
platform i386-pc-mingw32
arch i386
os   mingw32
system   i386, mingw32
status   Patched
major1
minor8.1
year 2003
month12
day  04
language R
array chip wrote:
Hi, how can I make the character label of the axes of
a plot darker (bolder), but not in a larger size?
--
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 452-1424 (M, W, F)
fax: (917) 438-0894
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Size of R user base

2004-04-19 Thread Kevin S. Van Horn
I have been trying to determine the size of the R user base, and was 
asked to share my findings with this mailing list.  Although I still 
don't have any definite estimate of this number, I do have some 
interesting and indicative information:

1. It appears that there are about 100,000 S-PLUS users.

Rationale: According to Insightful's 2002 Annual Report, over 100,000 
people use Insightful software; since license revenues from S-PLUS and 
add-on modules accounted for nearly all of their license revenues in 
2002, and their other products are much more costly than S-PLUS, it 
seems that the great majority of users of Insightful software are S-PLUS 
users.

Conclusion: S-PLUS costs $3500 (Windows) or $4500 (Linux/Unix) for an 
individual copy; R is free.  This suggests that there may be more R 
users than S-PLUS users, which suggests  100,000 R users.

Does anyone has any other information that would give some notion as to 
the RELATIVE numbers of R and S-PLUS users?

2. At least one R book has achieved sales of just over 5,000 copies.  (I 
could not find sales figures for other R books, as it appears that 
publishers are closed-mouthed about such figures.  And no, I can't 
reveal which particular book this was, so don't ask.)

Conclusion:  Very few books sell to more than 12% of the population of 
potential buyers, and most books have a far lower penetration -- 1% or 
less is not uncommon.  A 12% penetration for the book in question 
implies 42,000 R users; a more reasonable 5% penetration implies 100,000 
users.  A low 1% penetration implies 500,000 users.

3. There are a total of 3225 unique subscribers to the three R mailing 
lists.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] fill between lines

2004-04-19 Thread ivo welch
hi:  is it possible to color areas between two functions?  for example,

   x- 1:100;
   plot(x, x^2, type=l);
   lines(x,0.5*x^2, type=l);
   # better
   plotwithfill(x, x^2, 0.5*x^2, color=c(yellow, red);
where the first color is used if f(x)=x^2  g(x)=0.5*x^2, and the second 
for the reverse.  Help appreciated.

Regards, / ivo

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] fill between lines

2004-04-19 Thread Liaw, Andy
Nothing easily that I can think of.  You need to plot each `piece'
separately using polygon().  I.e.,

1. Find the `pieces'.
2. Determine the color the piece should be in.
3. Draw the piece with polygon().

Step 1 above is probably the trickiest part, but quite doable, I think.

Best,
Andy

 From: ivo welch
 
 hi:  is it possible to color areas between two functions?  
 for example,
 
 x- 1:100;
 plot(x, x^2, type=l);
 lines(x,0.5*x^2, type=l);
 # better
 plotwithfill(x, x^2, 0.5*x^2, color=c(yellow, red);
 
 where the first color is used if f(x)=x^2  g(x)=0.5*x^2, and 
 the second 
 for the reverse.  Help appreciated.
 
 Regards, / ivo
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] fill between lines

2004-04-19 Thread Roger D. Peng
If one function dominates the other, you can use polygon(),

x - 1:100
p - rbind(cbind(x, 0.5*x^2), cbind(rev(x), rev(x^2)))
matplot(x, cbind(x^2, 0.5*x^2), type = l, col = 1, lty = 1)
polygon(p, col = 2)
or some variant of that.

-roger

ivo welch wrote:
hi:  is it possible to color areas between two functions?  for example,

   x- 1:100;
   plot(x, x^2, type=l);
   lines(x,0.5*x^2, type=l);
   # better
   plotwithfill(x, x^2, 0.5*x^2, color=c(yellow, red);
where the first color is used if f(x)=x^2  g(x)=0.5*x^2, and the second 
for the reverse.  Help appreciated.

Regards, / ivo

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] thanks for fill

2004-04-19 Thread ivo welch
Hi:  thanks for the polygon recommendations.  these work like a charm 
for me.

minor documentation bug:  ?plot.default states lwd is not yet supported 
for postscript, but it does seem to work.

regards,

/iaw

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] error message in mle function

2004-04-19 Thread Bill Shipley
I am getting an error message concerning the estimation of confidence
intervals when fitting a mixed model and don't know what the problem is,
or its solution.

 

Just to provide context: the model is describing the effects of age,
exp(age), harvest age, and climate variables on bighorn horn annular
length.

 

The data structure is repeated measures (between individuals, within
individuals over time).

 

Id is a random effect (there are between 3-11 horn measurements per ram,
one horn measurement per age, over the 25 year period in the dataset).

 

The mixed effect results is unable to provide confidence intervals for
the fixed and random effects because: of an error in the
variance-covariance structure. The error says that the intervals are
non-positive definitive. 

 

 

Bill Shipley

 


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Informations about merge function

2004-04-19 Thread n\.bouget
Hello,
I want to have some informations about the merge function: indeed, I want te merge 
many data frames but I don't want to have missing value NA for the rows but the number 
0 for the rows who're not in all tables! I didn't see any options to do that!! and 
when I use function like na.omit and na.action to deal missing value (after merging 
all tables) and changing them in 0, after three hours I have no longer the results 
because I've got a data frame with 31 colonnes and more than 2 rows. Do you have a 
solution for me,
Thank you for answering,
Nicolas BOUGET.

Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34€/mn) ; tél : 08 92 68 13 50 (0,34€/mn)


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] specifying as.svrepdesign with odd number PSUs

2004-04-19 Thread Fred Rohde
Is there a way to create a BRR svrepdesign from a survey design when the number of 
PSUs is odd in one or more stratum?  Creating a JKn svrepdesign with that condition 
works okay, but when I tried to create a svrepdesign with type=BRR I get an error 
and this message:
 
 Can't split with odd numbers of PSUs in a stratum
 
I get that message when I tell it to merge the PSUs.   Maybe I'm just not doing it 
correctly.  I tried
 
svb - as.svrepdesign(sd, type=BRR)

svb - as.svrepdesign(sd, type=BRR, brrweights (large=merge))
svb - as.svrepdesign(sd, type=BRR, large=merge))
 
where sd is the survey design object.  None of these attempts made it past the error 
message.  Does BRR require the number of PSUs be even?  I was hoping it would randomly 
assign the last PSU (if the number is odd) to one or the other halves. Maybe that's 
naive.
 
The JKn method didn't seem to mind the odd-number of PSUs.  This worked okay.
 
svr - as.svrepdesign(sd, type=JKn).
 
Thanks.
 
Fred




-


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] specifying as.svrepdesign with odd number PSUs

2004-04-19 Thread Fred Rohde
Is there a way to create a BRR svrepdesign from a survey design when the number of 
PSUs is odd in one or more stratum?  Creating a JKn svrepdesign with that condition 
works okay, but when I tried to create a svrepdesign with type=BRR I get an error 
and this message:
 
 Can't split with odd numbers of PSUs in a stratum
 
I get that message when I tell it to merge the PSUs.   Maybe I'm just not doing it 
correctly.  I tried
 
svb - as.svrepdesign(sd, type=BRR)

svb - as.svrepdesign(sd, type=BRR, brrweights (large=merge))
svb - as.svrepdesign(sd, type=BRR, large=merge))
 
where sd is the survey design object.  None of these attempts made it past the error 
message.  Does BRR require the number of PSUs be even?  I was hoping it would randomly 
assign the last PSU (if the number is odd) to one or the other halves. Maybe that's 
naive.
 
The JKn method didn't seem to mind the odd-number of PSUs.  This worked okay.
 
svr - as.svrepdesign(sd, type=JKn).
 
Thanks.
 
Fred





-


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Size of R user base

2004-04-19 Thread Ted Harding
A very intriguing commentary!
Some comments to modulate these estimates.

On 19-Apr-04 Kevin S. Van Horn wrote:
 1. It appears that there are about 100,000 S-PLUS users.
 
 Rationale: According to Insightful's 2002 Annual Report, over 100,000 
 people use Insightful software; since license revenues from S-PLUS and 
 add-on modules accounted for nearly all of their license revenues in 
 2002, and their other products are much more costly than S-PLUS, it 
 seems that the great majority of users of Insightful software are
 S-PLUS 
 users.
 
 Conclusion: S-PLUS costs $3500 (Windows) or $4500 (Linux/Unix) for an 
 individual copy; R is free.  This suggests that there may be more R 
 users than S-PLUS users, which suggests  100,000 R users.
 
 Does anyone has any other information that would give some notion as to
 the RELATIVE numbers of R and S-PLUS users?

There is one major factor in here. The number of Windows users
in the world is much higher than the number of Unix/Linux users,
especially in the corporate sector. Organisations whose work
needs R/S-PLUS and whose IT is Windows based will (I believe)
mostly go for S-PLUS (I could expand in my reasons for believing
this). Therefore I suspect that in the 2-way table

  Windows  Unix/Linux
S-PLUS  N11   N12

R   N21   N22

you are likely to find that N11/N21  N12/N22.
Certainly N11+N21  N12+N22. This tends to imply N11+N12  N12+N22.
The relative cost of S-PLUS vs R is not likely to be a factor in
the choice, for most corporate users. Therefore I would lower your
estimate, here, of R usage quite a bit (though I can't guess by
how much).

 2. At least one R book has achieved sales of just over 5,000 copies. 
 (I could not find sales figures for other R books, as it appears that 
 publishers are closed-mouthed about such figures.  And no, I can't 
 reveal which particular book this was, so don't ask.)
 
 Conclusion:  Very few books sell to more than 12% of the population of 
 potential buyers, and most books have a far lower penetration -- 1% or 
 less is not uncommon.  A 12% penetration for the book in question 
 implies 42,000 R users; a more reasonable 5% penetration implies
 100,000 
 users.  A low 1% penetration implies 500,000 users.

Comment: More R users are likely to buy a book on R than S-PLUS
users are likely to buy a book on S-PLUS. S-PLUS users who do
buy a book may in fact buy a book on R rather than S-PLUS, if
that book is well known to be good. (I'm assuming that the
R book you refer to is R-specific rather than written for
both R and S-PLUS or for S-PLUS with R variations; otherwise
you have to take off the S-PLUS-only purchasers)

 3. There are a total of 3225 unique subscribers to the three R mailing 
 lists.

I think this may be the most directly informative piece of data
(though still on the soft side). People who use R are likely to
become aware of the mailing lists, and to subscribe. So I suspect
that this number exceeds say 20-40% of R users (you can't be precise
with this sort of intuitive guess). This would suggest 7000-16000 R
users.
You might perhaps double or triple this to allow for groups where
one member of the group subscribes as the spokesman for the rest.
Maybe also inflate a bit to allow for R users who don't think
they need to consult mailing lists (who are they??).

Hmmm!
Ted.



E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 167 1972
Date: 19-Apr-04   Time: 21:22:51
-- XFMail --

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] question about linear models.

2004-04-19 Thread Ted Harding
This would make a good exam question!

First, look at the distribution of levels:

  B=0   B=1   B=2   B=3
A=06------
A=1   -- 4 3 2
A=2   -- 2 3 4


And then look at the mean values within combinations of levels:

  B=0   B=1   B=2   B=3
A=0  1.15   ------  | 1.15
A=1   --   1.81  1.85  1.52 | 1.76
A=2   --   2.31  2.52  2.13 | 2.30
+--
 1.15  1.98  2.18  1.93 | 1.81
(Residual SE after fitting A+B = 0.38)

First, it is clear that (A=0) vs (A0) is exactly associated
with (B=0) vs (B0). Therefore any difference between means
for (A=0) vs (A0) is fully confounded with (B=0) vs (B0).
Clearly (from table of means) there *is* a difference here
(significant as it turns out), so fitting A alone will give
a significant result as will fitting B alone.

Further (table of means) the response increases almost linearly
with A (about 0.6/level), while it does not change much for
(B=1/2/3). So almost all if the variation with respect to B
is accounted for by the difference between (B=0) and (B0)
which is totally confounded with A. Therefore, once you have
fitted A, fitting B as an additional variate will not change
the fit significantly.

However, if you fit B first followed by adding A, you first
(B fit) take out the difference between (B=0) vs (B0),
equivalent to (A=0) vs (A0). However, from inspection of
table of means, while there is little differfence between
(B=1)/(B=2)/(B=3) nevertheless there is a systematic difference
at each level of B between (A=1) and (A=2) -- 0.5, 0.67
and 0.61 respectively. This shows up as an effect of A after
fitting B.

So, in summary, there is a significant effect of A alone (due
to the constant increase per increment in level); there is a
significant effect of B alone (due to the contrast between
(B=0) and (B0) equivalent to the contrast between (A=0)
and (A0)); however, once the effect of A has been allowed
for you only have the contrast between levels (B=1)/(B=2)/(B=3)
of B which do not differ enough to be significant. On the other
hand, fitting B first still leaves a constant effect of A
at each of the levels of B which shows up as significant for
A after fitting B. You do not have enough data to detect as
significant the sort of differences between levels of B=1/2/3.

Best wishes,
Ted.

==

On 19-Apr-04 [EMAIL PROTECTED] wrote:
 i have the following table with two factors A, B each respectively
 with 3 and 4 levels (unbalanced design)   
 
S1
  samples A B
 1  1.3398553 0 0
 2  0.8455924 0 0
 3  1.0290893 0 0
 4  1.2720512 0 0
 5  1.2071754 0 0
 6  1.1859539 0 0
 7  2.7399659 2 3
 8  1.2476911 2 3
 9  2.6389479 2 2
 10 1.6914068 1 2
 11 2.2260561 2 1
 12 1.2955187 1 1
 13 1.6526140 1 3
 14 2.3159151 2 3
 15 2.3905009 1 2
 16 2.9520105 2 2
 17 1.9478868 1 1
 18 1.9936118 1 1
 19 1.3775338 1 3
 20 1.9638190 2 2
 21 1.4697860 1 2
 22 2.2028858 2 3
 23 2.4024771 2 1
 24 1.9935864 1 1
 
 
 i fit two different models
 
 fit1-aov(samples~A + B,data=S1,contrasts = list(A = contr.treatment, B
 =
 contr.treatment))
 fit2-aov(samples~A,data=S1,contrasts = list(A = contr.treatment))
 fit3-aov(samples~B,data=S1,contrasts = list(B = contr.treatment))
 
 
 and using 
 
anova(fit1,fit2)
 Analysis of Variance Table
 
 Model 1: samples ~ A + B
 Model 2: samples ~ A
   Res.Df  RSS Df Sum of Sq  F Pr(F)
 1 19  2.74820   
 2 21  3.14667 -2  -0.39847 1.3774 0.2763
 
 i get B as not significant and
 
 
anova(fit1,fit3)
 
 Analysis of Variance Table
 
 Model 1: samples ~ A + B
 Model 2: samples ~ B
   Res.Df RSS Df Sum of Sq  F   Pr(F)   
 1 19  2.7482
 2 20  4.2391 -1   -1.4909 10.308 0.004604 **
 
 A as significant.
 
 
 
 however if i do
 
anova(fit3)
 
 Analysis of Variance Table
 
 Response: samples
   Df Sum Sq Mean Sq F value   Pr(F)   
 B  3 3.7241  1.2414  5.8567 0.004854 **
 Residuals 20 4.2391  0.2120
 
 
 i get B as significant and
 
anova(fit2)
 
 Analysis of Variance Table
 
 Response: samples
   Df Sum Sq Mean Sq F valuePr(F)
 A  2 4.8165  2.4083  16.072 5.835e-05 ***
 Residuals 21 3.1467  0.1498 
 
 A as significant.
 
 
 
 
 Should i conclude that A is significant and B is not or rather that
 both factors
 are significant ?
 
 
 all the best
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 167 1972
Date: 19-Apr-04   Time: 20:28:31
-- XFMail --

__
[EMAIL 

Re: [R] Size of R user base

2004-04-19 Thread Kevin S. Van Horn
(Ted Harding) wrote:

1. It appears that there are about 100,000 S-PLUS users.
   

[...]

Does anyone has any other information that would give some notion as to
the RELATIVE numbers of R and S-PLUS users?
   

There is one major factor in here. The number of Windows users
in the world is much higher than the number of Unix/Linux users,
especially in the corporate sector. Organisations whose work
needs R/S-PLUS and whose IT is Windows based will (I believe)
mostly go for S-PLUS (I could expand in my reasons for believing
this).
But R is available for Windows, too.  I've downloaded and installed both 
the Linux and Windows versions; neither task was difficult, and the 
Windows version had a rather nicer interface.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] fill between lines

2004-04-19 Thread Don MacQueen
It could be approximated with line segments, using the segments function.

Something like two calls similar to
   segments(x,x^2, x, 0.5*x^2)
one call where f  g, the other call f  g, using a different value 
for the 'col' argument

Make x very dense, say seq(1,100,len=1000) instead of 1:100, and it 
will look like it's filled.

-Don

At 2:16 PM -0400 4/19/04, ivo welch wrote:
hi:  is it possible to color areas between two functions?  for example,

   x- 1:100;
   plot(x, x^2, type=l);
   lines(x,0.5*x^2, type=l);
   # better
   plotwithfill(x, x^2, 0.5*x^2, color=c(yellow, red);
where the first color is used if f(x)=x^2  g(x)=0.5*x^2, and the 
second for the reverse.  Help appreciated.

Regards, / ivo

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


--
--
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Size of R user base

2004-04-19 Thread Prof Brian Ripley
On Mon, 19 Apr 2004, Kevin S. Van Horn wrote:

 2. At least one R book has achieved sales of just over 5,000 copies.  (I 
 could not find sales figures for other R books, as it appears that 
 publishers are closed-mouthed about such figures.  And no, I can't 
 reveal which particular book this was, so don't ask.)

Some of us know quite accurately, though.

 Conclusion:  Very few books sell to more than 12% of the population of 
 potential buyers, and most books have a far lower penetration -- 1% or 

Where did you get that 12% from?

 less is not uncommon.  A 12% penetration for the book in question 
 implies 42,000 R users; a more reasonable 5% penetration implies 100,000 
 users.  A low 1% penetration implies 500,000 users.

One S book has sold half your number of S-PLUS users, although some sales
are known to be to R users.

I have big problems with the definition.  What is an `R user'?  Someone 
who has ever used R, even for a one-hour practical class?  Someone who has 
used R in the last 3 months?  Even given a definition, I would not be able 
to give you an accurate answer for our site, for either S-PLUS or R.  
(There are machines with each installed that I strongly suspect are 
unused.)

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Size of R user base

2004-04-19 Thread Dirk Eddelbuettel
On Mon, Apr 19, 2004 at 10:27:25PM +0100, Prof Brian Ripley wrote:
  less is not uncommon.  A 12% penetration for the book in question 
  implies 42,000 R users; a more reasonable 5% penetration implies 100,000 
  users.  A low 1% penetration implies 500,000 users.
 
 One S book has sold half your number of S-PLUS users, although some sales
 are known to be to R users.

But then you also need to control for different editions and serial buyers.
I happen to have purchased three different editions of a certain S-Plus / R
book now in its 4th edition. 

My preference goes with the numbering scheme attributed to a tribe on some
island in the Pacific which consists of a 'factor' with four levels: 'one',
'two', 'three', and 'lots'.  Hence, I'd go with 'lots of R users'.

Dirk

-- 
The relationship between the computed price and reality is as yet unknown.  
 -- From the pac(8) manual page

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Size of R user base

2004-04-19 Thread Patrick Connolly
On Mon, 19-Apr-2004 at 04:47PM -0500, Dirk Eddelbuettel wrote:

| On Mon, Apr 19, 2004 at 10:27:25PM +0100, Prof Brian Ripley wrote:
|   less is not uncommon.  A 12% penetration for the book in question 
|   implies 42,000 R users; a more reasonable 5% penetration implies 100,000 
|   users.  A low 1% penetration implies 500,000 users.
|  
|  One S book has sold half your number of S-PLUS users, although some sales
|  are known to be to R users.
| 
| But then you also need to control for different editions and serial buyers.
| I happen to have purchased three different editions of a certain S-Plus / R
| book now in its 4th edition. 
| 
| My preference goes with the numbering scheme attributed to a tribe on some
| island in the Pacific which consists of a 'factor' with four levels: 'one',
| 'two', 'three', and 'lots'.  Hence, I'd go with 'lots of R users'.

So how will you distinguish your 4th edition of a certain S-Plus / R
book from what comes next?

-- 
Patrick Connolly
HortResearch
Mt Albert
Auckland
New Zealand 
Ph: +64-9 815 4200 x 7188
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~
I have the world`s largest collection of seashells. I keep it on all
the beaches of the world ... Perhaps you`ve seen it.  ---Steven Wright 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Size of R user base

2004-04-19 Thread A.J. Rossini
Patrick Connolly [EMAIL PROTECTED] writes:

 On Mon, 19-Apr-2004 at 04:47PM -0500, Dirk Eddelbuettel wrote:

 | On Mon, Apr 19, 2004 at 10:27:25PM +0100, Prof Brian Ripley wrote:
 |   less is not uncommon.  A 12% penetration for the book in question 
 |   implies 42,000 R users; a more reasonable 5% penetration implies 100,000 
 |   users.  A low 1% penetration implies 500,000 users.
 |  
 |  One S book has sold half your number of S-PLUS users, although some sales
 |  are known to be to R users.
 | 
 | But then you also need to control for different editions and serial buyers.
 | I happen to have purchased three different editions of a certain S-Plus / R
 | book now in its 4th edition. 
 | 
 | My preference goes with the numbering scheme attributed to a tribe on some
 | island in the Pacific which consists of a 'factor' with four levels: 'one',
 | 'two', 'three', and 'lots'.  Hence, I'd go with 'lots of R users'.

 So how will you distinguish your 4th edition of a certain S-Plus / R
 book from what comes next?

It's all lots, and I hope it stays (i.e. continues) that way.  

best,
-tony

-- 
[EMAIL PROTECTED]http://www.analytics.washington.edu/ 
Biomedical and Health Informatics   University of Washington
Biostatistics, SCHARP/HVTN  Fred Hutchinson Cancer Research Center
UW (Tu/Th/F): 206-616-7630 FAX=206-543-3461 | Voicemail is unreliable
FHCRC  (M/W): 206-667-7025 FAX=206-667-4812 | use Email

CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Size of R user base

2004-04-19 Thread Ted Harding
On 19-Apr-04 Kevin S. Van Horn wrote:
 (Ted Harding) wrote:
There is one major factor in here. The number of Windows users
in the world is much higher than the number of Unix/Linux users,
especially in the corporate sector. Organisations whose work
needs R/S-PLUS and whose IT is Windows based will (I believe)
mostly go for S-PLUS (I could expand in my reasons for believing
this).

 
 But R is available for Windows, too.  I've downloaded and installed
 both the Linux and Windows versions; neither task was difficult, and
 the Windows version had a rather nicer interface.

Thanks. I know that there is R for Windows, and I'm not disputing
your comparison between R for Linux and R for Windows, but my argument
was directed at the choices people would make between S-PLUS
for Windows and R for Windows, coupled with the fact that Windows
is much more prevalent than Unix/Linux.

Though they have the choice, I argue that many (especially corporate
but by no means only these) Windows-based organisations would go for
S-PLUS rather than R (for all sorts of reasons, ranging from
To install S-PLUS just plug in the CD and click to the manuals for
S-PLUS and add-ons which get the user, albeit potentially brainlessly,
from installation to data-analysis much more readily than the R
documentation which does demand considerable study, thought, and
development of understanding).

Not to mention that (in theory) S-PLUS as a commercial product could
be presumed to come with guarantees and support and, quite possibly
erroneously, expected to be a better-tested, more reliable, quality
product ... it's what they pay those $$000s for, isn't it?

So the gross preponderance of Windows, and the motives of many
Windows-based organisations, will (I argue) lead to a preponderance
of S-PLUS over R.

This preponderance would, I suspect, be less marked (could just
possibly swing the other way) for Unix users. But the net effect
overall would, I believe, be that S-PLUS would outnumber R.

Cheers,
Ted.



E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 167 1972
Date: 19-Apr-04   Time: 22:47:59
-- XFMail --

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] classification and association rules in R

2004-04-19 Thread Jason Turner
Rong-En Fan wrote:

 By the way, I heard that there are some people developing a better
 search interface for R (or CRAN?). Where are the related information
 I can get?

Strangely enough, by following the Search link on CRAN.

Jason

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Size of R user base

2004-04-19 Thread Kevin S. Van Horn
Prof Brian Ripley wrote:

Conclusion:  Very few books sell to more than 12% of the population of 
potential buyers, and most books have a far lower penetration -- 1% or 
   

Where did you get that 12% from?

A booklet on assessing financial feasibility in nonfiction book 
publishing.  That's a general figure, so perhaps it doesn't apply if the 
book in question is a must-have, definitive reference for the group in 
question... like the book you mention (if it's the one I think it is).

I have big problems with the definition. What is an `R user'? Someone  
who has ever used R, even for a one-hour practical class? Someone who 
has used R in the last 3 months?


Good question.  I guess I'd lean more towards your second definition, 
with the added caveat of and expects to use it again in the next 3 months.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Size of R user base

2004-04-19 Thread Jason Turner
Dirk Eddelbuettel wrote:
My preference goes with the numbering scheme attributed to a tribe on some
island in the Pacific which consists of a 'factor' with four levels: 'one',
'two', 'three', and 'lots'.
Australia.  I've been there.  Nice place.  ;)

Jason
(who is an Australian)
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] error message in mle function

2004-04-19 Thread Spencer Graves
 Is one of your variance components essentially estimating zero?  
If you check the numbers, delete the smallest one, and then do anova 
comparing the two fits, you might find that the one you deleted was not 
statistically significant. 

 If I'm not mistaken, lme estimates the logarithms of the 
variance components.  When one of them is zero, the logarithm wants to 
go to (-Inf).  In that case, lme will still return an answer.  
However, intervals complains, because the observed information matrix 
for the parameter estimates is singular in the direction of log(variance 
component) that wants to go to (-Inf).  Doug Bates, the developer of 
lme has taught many people about how to fix that problem using profile 
likelihood.  I have not seen lme4 yet, so the problem may already have 
been fixed.  If any if this is inaccurate, I hope Doug will correct me. 

 hope this helps. 
 Spencer Graves

Bill Shipley wrote:

I am getting an error message concerning the estimation of confidence
intervals when fitting a mixed model and don't know what the problem is,
or its solution.


Just to provide context: the model is describing the effects of age,
exp(age), harvest age, and climate variables on bighorn horn annular
length.


The data structure is repeated measures (between individuals, within
individuals over time).


Id is a random effect (there are between 3-11 horn measurements per ram,
one horn measurement per age, over the 25 year period in the dataset).


The mixed effect results is unable to provide confidence intervals for
the fixed and random effects because: of an error in the
variance-covariance structure. The error says that the intervals are
non-positive definitive. 





Bill Shipley



	[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] specifying as.svrepdesign with odd number PSUs

2004-04-19 Thread Thomas Lumley
On Mon, 19 Apr 2004, Fred Rohde wrote:

 Is there a way to create a BRR svrepdesign from a survey design when the
 number of PSUs is odd in one or more stratum?  Creating a JKn
 svrepdesign with that condition works okay, but when I tried to create a
 svrepdesign with type=BRR I get an error and this message:

  Can't split with odd numbers of PSUs in a stratum

Oh dear, how very frustrating, (or words to that effect).
The parameters aren't being passed on to brrweights().

You aren't supposed to be able to split a stratum with an odd number of
clusters, because the result won't be balanced.You are supposed to
be able to merge two strata with an odd number of clusters, but it isn't
working.  Note that it should only work when the number of odd strata is
even.  BRR is, fundamentally, intended for strata of size 2 and I think
there's something slightly dodgy about attempts to get around this.

-thomas

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] using subscripts in a plot title with 2 lines

2004-04-19 Thread Paul Murrell
Hi

Liaw, Andy wrote:
If I understood your problem correctly, one ugly way of getting around this
is to use call mtext() twice to put the two lines in the title area, using
the line argument to mtext to control the location of the lines.  E.g.,
something like:
plot(1, main=)
mtext(expression(IC[50]), line=3, side=3, cex=1.2)
mtext(of My Data, line=1.5, side=3, cex=1.2)


An alternative that keeps everything as one expression is to use atop() 
within the expression rather than the '\n'.  For example:

plot(1, main=)
mtext(expression(paste(atop(paste('Plot of Observed vs. Predicted 
-log(', IC[50], ') Values for the PDGFR'),'Dataset'))), side=3, line=1.5)

But this may still look too ugly :)

In general, '\n' will not be handled very well within mathematical 
expressions.

Paul


From: Rajarshi Guha

Hi,
 I'm making a plot in which the title takes up two lines. The title
contains a subscript but when I look at the plot it does'nt 
seem tocome
out properly. The code I'm using is:

  xtxt = expression(paste('Observed -log( ', IC[50], ' )'))
  ytxt = expression(paste('Predicted -log( ', IC[50], ' )'))
  mtxt = expression(paste('Plot of Observed vs. Predicted -log(',
IC[50], ') Values for the PDGFR\nDataset'))
  plot(tset$V2, tset$V3, xlim = c(-2,2), ylim = c(-2,2),
   pch = 19, col = blue, 
   main=mtxt,
   xlab = xtxt,
   ylab = ytxt)

Removing the IC[50] term makes it come out OK. 
Is there any way to get around this?

Thanks,

---
Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
---
Does Ramanujan know Polish?
-- E.B. Ross
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html




--
Notice:  This e-mail message, together with any attachments,...{{dropped}}
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
[EMAIL PROTECTED]
http://www.stat.auckland.ac.nz/~paul/
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Can't find memory.size()

2004-04-19 Thread Liaw, Andy
 From: Shin, Daehyok
 
 I try memory.size function to find out available memory size,
 but surprisingly R complains it can't find the function.
 ?memory.size also failed.
 
 Is it not in the base library?

Not really.  help.search(memory.size) in R-1.9.0 says:

memory.size(utils)   Report on Memory Allocation

so it's in `utils', which I believe is loaded by default.

 If so, why can't my R find it?
 I am using the binary 1.9.0 version for Mandrake 9.1.

Because Linux is not Windows...

Andy


 Thanks in advance.
 
 Daehyok Shin
 Terrestrial Hydrological Ecosystem Modellers
 Geography Department
 University of North Carolina-Chapel Hill
 [EMAIL PROTECTED]
 
 We can do no great things, 
 only small things with great love.
  - Mother Teresa
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 
 


--
Notice:  This e-mail message, together with any attachments,...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Error while loading R2HTML in Rprofile

2004-04-19 Thread Alexander.Herr
Hi List,

When loading library(R2HTML) in Rprofile I get the following error:

Error in firstlib(which.lib.loc, package) : 
couldn't find function ps.options
Error in library(R2HTML) : .First.lib failed
[Previously saved workspace restored]

% ps.options is there
% Loading the library from the command prompt works fine, other libraries load fine 
through Rprofile. 
% This only happens since R1.9.0.

Any ideas?

Thanks Herry

System: Windows XP on dual processor dell, 1gig ram.




Alexander Herr - Herry
Northern Futures
Davies Laboratory, CSIRO
PMB, Aitkenvale, QLD 4814
Phone (07) 4753 8510
Fax   (07) 4753 8650
Home: http://herry.ausbats.org.au
Webadmin ABS: http://ausbats.org.au
Sustainable Ecosystems: http://www.cse.csiro.au/

 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Rank - Descending order

2004-04-19 Thread Manoj - Hachibushu Capital
Dear All,
Is there any simple way to way to produce rank, for a given
list, but in a descending order?

E.G:
x   = list(a=c(1,5,2,4));
rank(x$a);  produces 1,4,2,3 

However I am looking for a way to generate (4,1,3,2). 

It would be particularly nice if the proposed solution has all
the niceties of rank function (like NA handling and ties.method
functionality) 


TIA

Manoj

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Rank - Descending order

2004-04-19 Thread Gabor Grothendieck

Here are a couple to try:

z - c(1,5,2,4)
rank(-rank(z))

# If z is numeric this can be simplified to:
rank(-z)

I haven't checked what happens to NAs and ties.method.


Manoj - Hachibushu Capital Wanzare at HCJP.com writes:

: 
: Dear All,
:   Is there any simple way to way to produce rank, for a given
: list, but in a descending order?
: 
:   E.G:
:   x   = list(a=c(1,5,2,4));
:   rank(x$a);  produces 1,4,2,3 
: 
:   However I am looking for a way to generate (4,1,3,2). 
: 
:   It would be particularly nice if the proposed solution has all
: the niceties of rank function (like NA handling and ties.method
: functionality) 
: 
: TIA
: 
: Manoj

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [Way OT] [R] Size of R user base

2004-04-19 Thread David Whiting
Jason Turner [EMAIL PROTECTED] writes:

And the Huli of Papua New Guinea use '15' to mean a very large number
and '15 times 15 samting (something)' to mean something close to
infinity.


 Dirk Eddelbuettel wrote:
  My preference goes with the numbering scheme attributed to a tribe on some
  island in the Pacific which consists of a 'factor' with four levels: 'one',
  'two', 'three', and 'lots'.
 
 Australia.  I've been there.  Nice place.  ;)
 
 Jason
 (who is an Australian)

-- 
David Whiting
Dar es Salaam, Tanzania

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html