Reasons not to answer very basic questions in a straightforward way; was: Re: [R] creating a sequence of object names

2004-11-29 Thread Uwe Ligges
John wrote:
Thank you, Uwe. I've found a way to do the job by
reading the FAQ 7.21 although it is not giving a
precise explanation to a novice or casual user at
first reading. For example, if you type the first two
But the corresponding help files do so, for sure, and the FAQ 7.21 
points you to ?assign and ?get.


lines in the FAQ, you get an error as you do not have
the variable, a, initially.
I am sure that more and more people get interested in
and serious about using R if advanced users are kind
enough to answer simple and silly questions as well
which are already explained in basic documentations.
Or is this community for highly motivated and advanced
R users only?
No, of course it is for novices as well!
BUT we do expect that novices do read basic documentation such as An 
Introduction to R and the R FAQ before asking question.
If there are too many silly questions from thousands of R users, nobody 
is able to manage the questions any more. And note that those people 
answering questions do it on a voluntary basis, and (at least partially) 
in their spare time!
Nobody would be subscribed to R-help any more, if there are 1000 mails a 
day, 900 of them containing silly questions! It is yet already hard 
enough to get through the huge amount of messages in a reasonable amount 
of time!

I have answered your question in a way,
 1) so that it is up to you to read some documentation. Now you have 
seen the FAQs and some help files. And you have learned much more than 
you would have learned if I had said Use assign()

 2) so that nobody feels too encouraged to ask questions before reading 
basic documentation - and my answer still saved you a lot of time!

Uwe Ligges


Regards,
John
 --- Uwe Ligges [EMAIL PROTECTED]
wrote: 

John wrote:

Hello R-users,
I wanted to generate objects named 'my.ftn1',
'my.ftn2', ... , 'my.ftn10', and tried the
following
code without success. How can I do this?

for ( i in 1:10 ) {
+ sub( , , paste(my.ftn, i)) - NULL
+ }
Error: Target of assignment expands to
non-language
object
Many thanks.
John
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
Please do as suggested above, read the posting
guide!
It suggests to read the FAQs. FAQ 7.21 is what you
are looking for: How 
can I turn a string into a variable?.

Uwe Ligges

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


Re: [R] hist and truehist

2004-11-29 Thread Gregor GORJANC
Peter thanks for the response.
So the results from hist(mydata) and truehist(mydata, h = .5) are the 
same. OK, but the sum of densities or intensities, for case that I gave, 
don't sum to 1 but to 2. Look bellow. I have an example where these 
density values are also up to 4 and sum to 5 (I have attached the PDF of 
that plot).

This is really frustrating for me. What are actually these intensisties 
and densities, how are they calculated. Why are they the same?

mydata - c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,4,5)
# histogram with frequencies
hist(mydata)
# histogram with ratios or probabilities
hist(mydata, freq = F) # what are that values on vertical axis
# lets take a look at values behind
x -hist(mydata, freq = F, plot = F); x
# Sum values
sum(x$intensities)
[1] 2.00
R  sum(x$density)
[1] 2.00
When I think of histogram (the one not with frequencies) I think of
gathering records into some classes and then divide the number of
records in each class by total number of all records. This is not the
case in hist().
Sorry for being pain in the ..., but this is really weird. Above that 
R-team is really doing a great job. Thanks for such a good tool!

--
Lep pozdrav / With regards / Con respeto,
Gregor GORJANC
---
University of Ljubljana
Biotechnical Faculty   URI: http://www.bfro.uni-lj.si
Zootechnical Departmentmail: gregor.gorjanc at bfro.uni-lj.si
Groblje 3  tel: +386 (0)1 72 17 861
SI-1230 Domzalefax: +386 (0)1 72 41 005
Slovenia
---


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

RE: [R] Storing loop output from a function

2004-11-29 Thread Martin Maechler
 UweL == Uwe Ligges [EMAIL PROTECTED]
 on Sat, 27 Nov 2004 17:09:26 +0100 writes:

UweL Andrew Kniss wrote:
 I am attempting to write an R function to aid in time series diagnostics.
 The tsdiag() works well, but I would prefer to get a plot with ACF, PACF,
 and Ljung-Box p-values of residuals.  In my attempt to get to that 
point, I
 am writing a function to calculate Ljung-Box p-values for residuals at
 various lag distances.
 
 ljung - function(fit) 
   for(i in c(1:24,36,48))   
{box-(Box.test(fit$residuals, lag=i, type=Ljung-Box)) 
 print(c(i, box$p.value))}
 

UweL You need to return() rather than print() the object.

and Andy Liaw correctly remarked that

AndyL Yes, but print() is supposed to return (invisibly) its argument(s)...

Yes.
But I'm pretty sure, Andrew's problem is to get all the p-values back
from his function and not just the last one

Which -- (together with making 'lags' a function argument)
would be something like

ljung - function(fit, lags = c(1:24,36,48)) 
{
nl - length(lags)
r - numeric(nl)
for(i in 1:nl)
   r[i] - Box.test(fit$residuals, lag= lags[i], type=Ljung-Box)
r
}

or, simply, more elegantly and efficiently, 
but a bit harder to understand for a beginner,

ljung - function(fit, lags = c(1:24,36,48)) 
sapply(lags, function(ll) 
   Box.test(fit$residuals, lag = ll, type=Ljung-Box))

Martin Maechler, ETH Zurich

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


Re: [R] hist and truehist

2004-11-29 Thread Uwe Ligges
Gregor GORJANC wrote:
Peter thanks for the response.
So the results from hist(mydata) and truehist(mydata, h = .5) are the 
same. OK, but the sum of densities or intensities, for case that I gave, 
don't sum to 1 but to 2. Look bellow. I have an example where these 
density values are also up to 4 and sum to 5 (I have attached the PDF of 
that plot).

This is really frustrating for me. What are actually these intensisties 
and densities, how are they calculated. Why are they the same?

mydata - c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,4,5)
# histogram with frequencies
hist(mydata)
# histogram with ratios or probabilities
hist(mydata, freq = F) # what are that values on vertical axis
# lets take a look at values behind
x -hist(mydata, freq = F, plot = F); x
# Sum values
sum(x$intensities)
[1] 2.00
R  sum(x$density)
[1] 2.00

Well, look at the breaks! Each has with 0.5
Hence the you have to calculate sum(x$density)*0.5
Uwe Ligges

When I think of histogram (the one not with frequencies) I think of
gathering records into some classes and then divide the number of
records in each class by total number of all records. This is not the
case in hist().
Sorry for being pain in the ..., but this is really weird. Above that 
R-team is really doing a great job. Thanks for such a good tool!


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


RE: [R] lm help: using lm when one point is known (not y intercept)

2004-11-29 Thread Martin Maechler
 JohnF == John Fox [EMAIL PROTECTED]
 on Sat, 27 Nov 2004 23:49:08 -0500 writes:

JohnF Dear Seth,

JohnF You don't say which variable is the explanatory
JohnF variable and which is the response, but assuming that
JohnF prob is to be regressed on effect, you can fit
JohnF lm(prob - 50 ~ I(effect + 37.25) - 1). That is you
JohnF can shift the point through which the regression is
JohnF to go to the origin and then force the regression
JohnF through the origin.

JohnF I hope this helps,
yes, nice!

Even a bit more useful {though slightly uglier} is to use offset():

 mfit - lm(prob ~ offset(50+ 0*effect) + I(effect + 37.25) - 1)

such that e.g. predict(mfit, ...) will still predict 'prob'

Note however that for both solutions, the regression abline()
will look wrong {and I hoped it would also be ok when using offset()},
plot(prob ~ effect)  ; abline(mfit)

Martin


JohnF John

JohnF 
JohnF John Fox
JohnF Department of Sociology
JohnF McMaster University
JohnF Hamilton, Ontario
JohnF Canada L8S 4M4
JohnF 905-525-9140x23604
JohnF http://socserv.mcmaster.ca/jfox 
JohnF  

 -Original Message-
 To: [EMAIL PROTECTED]
 Subject: [R] lm help: using lm when one point is known (not y intercept)
 
 Hello-
 
 My question is a short one.  How can I specify a single point 
 which through the fitted linear model has to go through?  To 
 illustrate my problem, the fit to following data must go 
 through the point (-37.25(effect), 50(prob)).  Note: you can 
 ignore the label column.
 
 Effect  Prob Label
 
 1 -1143.75  7.142857 L
 2  -572.75 21.428571 D
 3  -223.75 35.714286GL
 4   123.25 50.00DG
 5   359.75 64.285714 G
 6   374.75 78.571429   DGL
 7   821.75 92.857143DL
 
 Thanks in advance!
 
 Seth Imhoff

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


RE: [R] Tcl error - brace in argument?

2004-11-29 Thread Matthew Dowle

Peter,

Yes c(0,23) works.

Many thanks!
Matthew


-Original Message-
From: Peter Dalgaard [mailto:[EMAIL PROTECTED] 
Sent: 26 November 2004 16:43
To: Peter Dalgaard
Cc: Matthew Dowle; '[EMAIL PROTECTED]'
Subject: Re: [R] Tcl error - brace in argument?


Peter Dalgaard [EMAIL PROTECTED] writes:

 Matthew Dowle [EMAIL PROTECTED] writes:
 
  Hi all,
   
  Does anyone know a solution for this error ?
   
   tkwidget(dlg, iwidgets::spinint, range={0 23})
 
 I suspect you want range=as.tclObj(c(0,23)) or something like that, 
 i.e. a Tcl list of two numbers, not a five-character string.

On second thoughts: I think range=c(0,23) should do.

-- 
   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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] PlotML

2004-11-29 Thread Gregoire Thomas
Dear all,
Has anybody ever written some plot / hist functions that would return 
PlotML code? [http://ptolemy.eecs.berkeley.edu/]
Regards,
Gregoire
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: Reasons not to answer very basic questions in a straightforward way; was: Re: [R] creating a sequence of object names

2004-11-29 Thread John
Dear Uwe,

I must say that I had thanked you for referring me to
the specific and exact FAQ 7.21 and I had solved my
simple problem from it. I alreadly had looked at some
of basic materials like 'An Introduction to R', 'R for
Beginners', 'R Data Import/Export as well as the
FAQ(that is, I know how to use ?assign and ?get). But,
because I am not going to be an expert in R I assume
that I have missed something (even very trivial) in
those documents. Of course, I can read them again and
again until I know everything in them. That is for
more interested enthusiasts, however. 

I know very well that it is basic manners to read
those materials before asking questions here, but you
should also understand that people sometimes get stuck
with very simple problems if they are driven by stress
or run down. They can save a lot of time and
concentrate on and develop their primary jobs instead.
And I don't think you should be worried about 900
silly questions out of 1000 messages posted because
they are at least well-educated people who know what
reading basic materials before posting questions
means.

People can learn diverse solutions about their simple
questions, from advanced experienced users, that
sometimes contain much more informations and tips.
It is up to users(not necessarily advanced users)
whether or not they are willing to answer questions
and share their precious (even little) findings in
programming. Volunteers can simply ignore silly
questions if they are not appropriate for answering.
Or I would let them know what to do with their
improper questions in a personal email.

Finally, I do appreciate your answer again and other
people's active replies too. It was really useful to
point me to the specific FAQ rather than to just say
'look at the FAQ'. It simply occurred to my mind that
kindness is the best policy for good education.

I beg your pardon if this message is not relevant to
this help list.

With kind regards,

John


 --- Uwe Ligges [EMAIL PROTECTED]
wrote: 
 John wrote:
  Thank you, Uwe. I've found a way to do the job by
  reading the FAQ 7.21 although it is not giving a
  precise explanation to a novice or casual user at
  first reading. For example, if you type the first
 two
 
 But the corresponding help files do so, for sure,
 and the FAQ 7.21 
 points you to ?assign and ?get.
 
 
  lines in the FAQ, you get an error as you do not
 have
  the variable, a, initially.
 
  I am sure that more and more people get interested
 in
  and serious about using R if advanced users are
 kind
  enough to answer simple and silly questions as
 well
  which are already explained in basic
 documentations.
  Or is this community for highly motivated and
 advanced
  R users only?
 
 No, of course it is for novices as well!
 
 BUT we do expect that novices do read basic
 documentation such as An 
 Introduction to R and the R FAQ before asking
 question.
 If there are too many silly questions from thousands
 of R users, nobody 
 is able to manage the questions any more. And note
 that those people 
 answering questions do it on a voluntary basis, and
 (at least partially) 
 in their spare time!
 Nobody would be subscribed to R-help any more, if
 there are 1000 mails a 
 day, 900 of them containing silly questions! It is
 yet already hard 
 enough to get through the huge amount of messages in
 a reasonable amount 
 of time!
 
 
 I have answered your question in a way,
 
   1) so that it is up to you to read some
 documentation. Now you have 
 seen the FAQs and some help files. And you have
 learned much more than 
 you would have learned if I had said Use assign()
 
   2) so that nobody feels too encouraged to ask
 questions before reading 
 basic documentation - and my answer still saved you
 a lot of time!
 
 Uwe Ligges
 
 
 
 
  Regards,
  
  John
  
  
   --- Uwe Ligges [EMAIL PROTECTED]
  wrote: 
  
 John wrote:
 
 
 Hello R-users,
 
 I wanted to generate objects named 'my.ftn1',
 'my.ftn2', ... , 'my.ftn10', and tried the
 
 following
 
 code without success. How can I do this?
 
 
 
 for ( i in 1:10 ) {
 
 + sub( , , paste(my.ftn, i)) - NULL
 + }
 Error: Target of assignment expands to
 
 non-language
 
 object
 
 
 Many thanks.
 
 John
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 
 http://www.R-project.org/posting-guide.html
 
 
 Please do as suggested above, read the posting
 guide!
 It suggests to read the FAQs. FAQ 7.21 is what you
 are looking for: How 
 can I turn a string into a variable?.
 
 Uwe Ligges
 
  
  
  __
  [EMAIL PROTECTED] mailing list
  https://stat.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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 

[R] core dump during make check when building 64-bit R on Solaris 8/9

2004-11-29 Thread CHAN Chee Seng
Hi,

I am building a 64-bit R 2.0.1 on Solaris 9.  The compiler is Sun Studio
8.  Make was successful but I have a core dump during a make check.  By
the way, this problem also happens on my Solaris 8 machine though I did
not get a core dump.  I do not have 64-bit versions of the readline,
tcl/tk, libncurses, etc libraries so these caused configure not to use
them with ELFCLASS32 errors.

I use the following flags in config.site:
CC=cc -xarch=v9
CFLAGS=-xO5 -xlibmil -dalign
F77=f95 -xarch=v9
FFLAGS=-xO5 -xlibmil -dalign
CXX=CC -xarch=v9


I pasted the make check error messages below:
$ make check
collecting examples for package 'base' ...
  Building/Updating help pages for package 'base'
 Formats: text html latex example 
running code in 'base-Ex.R' ...*** Error code 1
make: Fatal error: Command failed for target `base-Ex.Rout'
Current working directory /export/home/cheeseng/R-2.0.1/tests/Examples
*** Error code 1
make: Fatal error: Command failed for target `test-Examples-Base'
Current working directory /export/home/cheeseng/R-2.0.1/tests/Examples
*** Error code 1
make: Fatal error: Command failed for target `test-Examples'
Current working directory /export/home/cheeseng/R-2.0.1/tests
*** Error code 1
make: Fatal error: Command failed for target `test-all-basics'
Current working directory /export/home/cheeseng/R-2.0.1/tests
*** Error code 1
make: Fatal error: Command failed for target `check'


The last few lines in base-Ex.Rout.fail is:
 ### * kappa
 
 flush(stderr()); flush(stdout())
 
 ### Name: kappa
 ### Title: Estimate the Condition Number
 ### Aliases: kappa kappa.default kappa.lm kappa.qr kappa.tri
 ### Keywords: math
 
 ### ** Examples
 
 kappa(x1 - cbind(1,1:10))# 15.71
[1] 15.70590


Doing a dbx on the core dump shows that the following:
program terminated by signal SEGV (no mapping at the fault address)
0x790fdf54: ___pl_dgesdd_64_+0x1654:std  %f4, [%o1]

I hope some one have a more successful build and can show how you did
it.

Thanks,
Chee Seng
UNIX Administrator
Genome Institute of Singapore
60 Biopolis Street, Genome
#02-01 Singapore 138672
DID 64788065
--- 
This email is confidential and may be privileged.  If you are not the
intended recipient, please delete it and notify us immediately. Please
do not copy or use it for any purpose, or disclose its contents to any
other person. Thank you.

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


Re: [R] PlotML

2004-11-29 Thread Peter Dalgaard
Gregoire Thomas [EMAIL PROTECTED] writes:

 Dear all,
 Has anybody ever written some plot / hist functions that would return
 PlotML code? [http://ptolemy.eecs.berkeley.edu/]

Not that I know of, and looking at the design of PlotML, it doesn't
look like a nice fit as an R device driver. PlotML works at the level
of data sets, bar graphs, axes, etc., not with low-level items like
lines, polygons, and text. There are general XML handling tools in the
XML package, though.

-- 
   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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Call to trellis.focus(); thenpanel.superpose()

2004-11-29 Thread John Maindonald
The following works fine with the x11 device, though it
may well be that an initial plot is overwritten.  With a pdf
or postscript device, I get two plots, the first of which
still has the red border from having the focus, while the
second is the plot that I want.
library(lattice); library(grid)
plt - xyplot(uptake ~ conc, groups=Plant, data=CO2)
print(plt)
trellis.focus(panel, row=1, column=1)
arglist=trellis.panelArgs()
arglist$type - l
do.call(panel.superpose, args=arglist)
trellis.unfocus()
Should I be able to use panel.superpose() in this way?
The new abilities provided by trellis.focus() etc add
greatly to the flexibility of what can be done with lattice
plots.  The grid-lattice combination is a great piece of
software.
John Maindonald email: [EMAIL PROTECTED]
phone : +61 2 (6125)3473fax  : +61 2(6125)5549
Centre for Bioinformation Science, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R: nnet questions

2004-11-29 Thread Clark Allan
hi all

i'm new to the area of neural networks. i've been reading some
references and seem to understand some of the learning algorithms. i am
very familiar with regression and would just like to see how neural nets
handle this problem so i've been using the nnet package.

i simply want to use a 3 layer neural net, ie 1 input, 1 hidden layer
(where the hidden layer is linear, since i want to basically perform
regression analysis by means of neural nets) and 1 output layer.

the x and y vector was simulated as follows:
x-1:100
x
  [1]   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16 
17  18
 [19]  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34 
35  36
 [37]  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52 
53  54
 [55]  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70 
71  72
 [73]  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88 
89  90
 [91]  91  92  93  94  95  96  97  98  99 100

y-2+5*x+rnorm(100)*5

y
  [1]   8.789605  11.151109  14.622276  30.381379  19.328647  29.317038 
33.793720  39.557390  51.939294  45.045965
 [11]  58.783991  63.191745  72.882202  79.184778  85.034551  94.446000 
89.243004  88.223547 106.327683 104.424668
 [21] 103.057648 112.855778 111.777823 108.359485 128.956152 127.369102
128.784481 139.760279 151.959887 152.014623
 [31] 158.869586 167.030970 166.711160 177.415680 173.542293 182.484224
179.767128 192.284343 196.173830 202.353030
 [41] 220.449623 213.410307 216.746041 219.812526 230.440402 230.759429
239.311279 244.151390 248.637023 254.648298
 [51] 262.694237 253.619539 276.975714 280.395284 280.173787 286.813617
284.766870 296.705692 295.110064 304.709464
 [61] 305.650793 310.128992 314.035624 314.649213 322.958865 333.640203
342.538307 340.546359 342.433629 344.720633
 [71] 354.115051 363.631246 371.479886 367.066764 377.184512 386.634677
392.310577 386.151325 400.345393 408.831710
 [81] 413.999148 405.009358 418.679828 418.388427 419.282955 432.329471
433.448313 444.166060 447.773185 455.103503
 [91] 448.588598 464.410358 465.565875 478.677403 478.306390 479.565728
487.681689 491.422090 502.468491 500.385458


i then went about to use the nnet function:

 a.net-nnet(y~x,linout=T,size=1)
# weights:  4
initial  value 8587786.130082 
iter  10 value 2086583.979646
final  value 2079743.529111 
converged

NOTE: the function said that four weights were estimated. This is
correct as shown below. the model can be represented as:

input   ---(w1)---hidden   ---(w2)---   output

x   --a1+w1*x  --   a2+w2*(a1+w1*x) 


where:
wi  are the weights, i=1,2
x   is an input pattern


further results were:

summary(a.net)
a 1-1-1 network with 4 weights
options were - linear output units 
  b-h1  i1-h1 
-276.48 -295.11 
   b-o   h1-o 
 254.92  764.72 


is the following statement correct? (i think that it is!)
a1= b-h1
w1= i1-h1
a2= b-o
w2= h1-o


If the hidden layer and the output layers are both LINEAR then the
following should be true:
1.  2= a2+a1*w2
2.  5= w1*w2

THIS IS NOT THE CASE, see the results. The only thing that i can think
of thats happening is that the activation function from the hidden layer
is not linear. Is this correct since i used the linout=T arguement? are
we able to change the activation function from the hidden layer?



two other questions:
1.  with regard to the size arguement, how does one know how many nodes
are in the hidden layer? (this might be a silly question.) e.g we   might
have 2 hidden layers both with 3 nodes.
2.  are we able to plot the drop in the error function as a function of
the epochs?


hope someone can help

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

[R] RE: Adding a line in the graph of 'plot()'

2004-11-29 Thread Doran, Harold
Yes. See ?abline or ?lines

-Original Message- 
From: [EMAIL PROTECTED] on behalf of [EMAIL PROTECTED] 
Sent: Sun 11/28/2004 8:35 PM 
To: [EMAIL PROTECTED] 
Cc: 
Subject: [R]: Adding a line in the graph of 'plot()'



Hello.

I'm looking for a way to add a line in a plot of a points that should 
lie
along a particular line. Can I add a line to the 'plot()' function, 
maybe
using 'abline()' so that the line is visible in the graph of 'plot()'? 
How?
More generally, can I overlay plots over one another?

Thanks.

Dean Vrecko
Simon Fraser University

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



[[alternative HTML version deleted]]

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


[R] Ts analysis with R: a contribute in Italian language

2004-11-29 Thread Vito Ricci
Dear All,

I wish to inform, especially Italian speaking R-users,
that on CRAN web site is now available a contribute
(in Italian language) about using R in ts analysis.

Any comments would be appreciated.

Best regards,
Vito


=
Diventare costruttori di soluzioni
Became solutions' constructors

The business of the statistician is to catalyze 
the scientific learning process.  
George E. P. Box


Visitate il portale http://www.modugno.it/
e in particolare la sezione su Palese  http://www.modugno.it/archivio/palese/

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


[R] plot problem

2004-11-29 Thread william ritchie
Dear all,

I am having trouble plotting a PCA result. The plot doesn't appear!!!
R goes through without any errors but doesn't make a plot appear!!
Could it be wrong window parameters? In this case how do I change them?
I am under red hat 9 with the latest version of R!

Thanks.






Vous manquez d’espace pour stocker vos mails ?

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


[R] Building latest version of package

2004-11-29 Thread michael watson \(IAH-C\)
Hi

I have a package which was built using R 1.9.1 and everything worked
fine.  I recently upgraded to R 2.0.1 and tried to re-install my package
- and I got:

Error in library(mypackage) : 'mypackage' is not a valid package --
installed  2.0.0?

So I tried rebuilding it using my new version of R:

R CMD BUILD --binary mypackage

hhc: not found
cp: cannot stat `mypackage.chm': No such file or directory
make[1]: *** [chm-mypackage] Error 1
make: *** [pkg-mypackage] Error 2
*** Installation of mypackage failed ***

Removing 'f:/tmp/Rbuild.2972/mypackage'
 ERROR
* installation failed

I didn't have these problems before.  What is hhc and why can't R find
it?

In general, will I have to re-build my package everytime a new version
of R is released?

Many thanks

Mick

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


[R] plotting data in non-orthogonal coords.

2004-11-29 Thread Andreas Franke
Hi !
I am wondering how to plot data (e.g.  f(x,y) ) in a coordinate system spanned 
by two non-orthogonal basis vectors (e.g. hexagonal symmetry). The data is 
given on an equally spaced grid in theses coords and i would like to do a 
contour plot (e.g. with filled.contour).

Thanks for your help. Andreas

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


[R] non-visible functions in return to methods()

2004-11-29 Thread steve houghton
Please point me to the documentation explaining why some of the functions 
returned
by calling methods() are marked as non-visible and whether there is indeed 
no way of
viewing the R code of such functions

thanks
Steve
_
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger

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


Re: [R] non-visible functions in return to methods()

2004-11-29 Thread Roger D. Peng
non-visible functions are hidden in a namespace.  You can view the 
code by using getS3method().

-roger
steve houghton wrote:
Please point me to the documentation explaining why some of the 
functions returned
by calling methods() are marked as non-visible and whether there is 
indeed no way of
viewing the R code of such functions

thanks
Steve
_
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger

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

--
Roger D. Peng
http://www.biostat.jhsph.edu/~rpeng/
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] problem with using transace

2004-11-29 Thread anne . piotet
I am trying to use the Hmisc function transace to transform predictors

 test-cbind(flowstress,pressres,alloy)
 xtrans-transace(x,binary=pressres',monotonic='flowstress', 
 categorical='alloy')


and I am getting the following message¨
Error in ace(x[, -i], x[, i], monotone = im, categorical = ic) : 
   unused argument(s) (monotone ...)

Any idea?

thanks anne
thank for your help
Anne



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


RE: Reasons not to answer very basic questions in a straightforwa rd way; was: Re: [R] creating a sequence of object names

2004-11-29 Thread Liaw, Andy
I'd like to make just a couple of points:

R-help is considered by quite a few people to be high-traffic.  As such,
many have low appetite for very basic questions.  (I wouldn't call them
silly.)  In many cases such questions are answered by pointing to a
particular function help page or manual section.  In this particular case,
it's probably not at the very basic level that would be covered in An
Introduction to R.  However, it _is_ a bona fide FAQ, thus the entry 7.21
in the R-FAQ.  Now, if there's ever one type of questions that many do not
like to see in a mailing list, it's one that can be found in the list FAQ,
as one of the main reasons for having the FAQ is to prevent such questions
from being asked over and over again on the list.

Now, if after reading the FAQ entry, you still can't solve the problem, then
you should tell us that, as well as how you tried and failed, so people have
a much better idea where you went off track, and are more likely to give you
more useful help.  This is in the Posting Guide, which suggest ways to ask
question that maximize the probability of getting useful replies.  Reading
that is to your own benefit, as well as others on the list.

As Duncan Murdoch said in a reply to a poster complaining (essentially about
being told to RTFM) on R-devel, we are not asking you to read these things
over and over again, nor on a periodic basis, but please do try to at least
take a glance before posting.  Posts that get less than enthusiastic
response are usually ones that showed that posters' unwillingness to do the
minimal work to help themselves, not because they are considered `dumb' or
`silly'.  In such cases people are much less willing to help.

Cheers,
Andy

 From: John
 
 Dear Uwe,
 
 I must say that I had thanked you for referring me to
 the specific and exact FAQ 7.21 and I had solved my
 simple problem from it. I alreadly had looked at some
 of basic materials like 'An Introduction to R', 'R for
 Beginners', 'R Data Import/Export as well as the
 FAQ(that is, I know how to use ?assign and ?get). But,
 because I am not going to be an expert in R I assume
 that I have missed something (even very trivial) in
 those documents. Of course, I can read them again and
 again until I know everything in them. That is for
 more interested enthusiasts, however. 
 
 I know very well that it is basic manners to read
 those materials before asking questions here, but you
 should also understand that people sometimes get stuck
 with very simple problems if they are driven by stress
 or run down. They can save a lot of time and
 concentrate on and develop their primary jobs instead.
 And I don't think you should be worried about 900
 silly questions out of 1000 messages posted because
 they are at least well-educated people who know what
 reading basic materials before posting questions
 means.
 
 People can learn diverse solutions about their simple
 questions, from advanced experienced users, that
 sometimes contain much more informations and tips.
 It is up to users(not necessarily advanced users)
 whether or not they are willing to answer questions
 and share their precious (even little) findings in
 programming. Volunteers can simply ignore silly
 questions if they are not appropriate for answering.
 Or I would let them know what to do with their
 improper questions in a personal email.
 
 Finally, I do appreciate your answer again and other
 people's active replies too. It was really useful to
 point me to the specific FAQ rather than to just say
 'look at the FAQ'. It simply occurred to my mind that
 kindness is the best policy for good education.
 
 I beg your pardon if this message is not relevant to
 this help list.
 
 With kind regards,
 
 John
 
 
  --- Uwe Ligges [EMAIL PROTECTED]
 wrote: 
  John wrote:
   Thank you, Uwe. I've found a way to do the job by
   reading the FAQ 7.21 although it is not giving a
   precise explanation to a novice or casual user at
   first reading. For example, if you type the first
  two
  
  But the corresponding help files do so, for sure,
  and the FAQ 7.21 
  points you to ?assign and ?get.
  
  
   lines in the FAQ, you get an error as you do not
  have
   the variable, a, initially.
  
   I am sure that more and more people get interested
  in
   and serious about using R if advanced users are
  kind
   enough to answer simple and silly questions as
  well
   which are already explained in basic
  documentations.
   Or is this community for highly motivated and
  advanced
   R users only?
  
  No, of course it is for novices as well!
  
  BUT we do expect that novices do read basic
  documentation such as An 
  Introduction to R and the R FAQ before asking
  question.
  If there are too many silly questions from thousands
  of R users, nobody 
  is able to manage the questions any more. And note
  that those people 
  answering questions do it on a voluntary basis, and
  (at least partially) 
  in their spare time!
  Nobody would be 

RE: [R] non-visible functions in return to methods()

2004-11-29 Thread Liaw, Andy
You mean something like ?methods, which says:

Value:

 An object of class 'MethodsFunction', a character vector of
 function names with an 'info' attribute. There is a 'print'
 method which marks with an asterisk any methods which are not
 visible: such functions can be examined by 'getS3method' or
 'getAnywhere'.

??

Andy

 From: steve houghton
 
 Please point me to the documentation explaining why some of 
 the functions 
 returned
 by calling methods() are marked as non-visible and whether 
 there is indeed 
 no way of
 viewing the R code of such functions
 
 thanks
 
 Steve
 
 _
 Stay in touch with absent friends - get MSN Messenger 
 http://www.msn.co.uk/messenger
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: Reasons not to answer very basic questions in a straightforwa rd way; was: Re: [R] creating a sequence of object names

2004-11-29 Thread A.J. Rossini
lots of good points from Andy and Uwe deleted

and perhaps the most important reason for the particular socratic form
of teaching on this list are the number of to-be, current, and former
faculty members who feel compelled to teach general solutions to the
problems (reading the FAQ is a rather general solution, eh?) rather
than spoonfeed answers.  This is a bit unlike some of the program
language mailing lists where the care and feeding of personal egos is
also part of the scene.  (of course, I'm not referring to the wizards
lists...!).

best,
-tony

---
A.J. Rossini
[EMAIL PROTECTED]

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


Re: [R] non-visible functions in return to methods()

2004-11-29 Thread Martin Maechler
 Roger == Roger D Peng [EMAIL PROTECTED]
 on Mon, 29 Nov 2004 08:48:04 -0500 writes:

Roger non-visible functions are hidden in a namespace.  
yes.

Roger You can view the  code by using getS3method().

not always {namely when the hidden function is not an S3 method}

getAnywhere() is more generally useful, but please consider my
post from half a year ago
   
   https://stat.ethz.ch/pipermail/r-help/2004-May/050112.html

which gives more explanations and possibilities.

Roger steve houghton wrote:
 Please point me to the documentation explaining why some of the 
 functions returned
 by calling methods() are marked as non-visible and whether there is 
 indeed no way of
 viewing the R code of such functions
 
 thanks
 
 Steve

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


[R] systemfit - SUR

2004-11-29 Thread contact

Hello to everyone,

I have 2 problems and would be very pleased if anyone can help me:

1) When I use the package systemfit for SUR regressions, I get two
different variance-covariance matrices when I firstly do the SUR
regression (The covariance matrix of the residuals used for
estimation) and secondly do the OLS regressions. In the manual for
systemfit on page 14 I see however, that the variance-covariance
matrix for SUR is obtained from OLS. How can this be explained?

2) Is there an easy possibility to test a) the OLS equations, and b) the
SUR system for SUR structures? In other words: Is the LM-Test from
Breusch and Pagan available in R?

Thanks for the attention!

Best Regards,
Thomas Almer

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


Re: [R] systemfit - SUR

2004-11-29 Thread Arne Henningsen
On Monday 29 November 2004 16:42, [EMAIL PROTECTED] wrote:
 Hello to everyone,

 I have 2 problems and would be very pleased if anyone can help me:

 1) When I use the package systemfit for SUR regressions, I get two
 different variance-covariance matrices when I firstly do the SUR
 regression (The covariance matrix of the residuals used for
 estimation) and secondly do the OLS regressions. In the manual for
 systemfit on page 14 I see however, that the variance-covariance
 matrix for SUR is obtained from OLS. How can this be explained?

Hi Thomas,
I get identical residual covariance matrices:

R library(systemfit)
R data( kmenta )
R demand - q ~ p + d
R supply - q ~ p + f + a
R labels - list( demand, supply )
R system - list( demand, supply )
R fitols - systemfit(OLS, system, labels, data=kmenta )
R fitols$rcov
 [,1] [,2]
[1,] 3.725391 4.136963
[2,] 4.136963 5.784441
R fitsur - systemfit(SUR, system, labels, data=kmenta )
R fitsur$rcovest
 [,1] [,2]
[1,] 3.725391 4.136963
[2,] 4.136963 5.784441

Did you do _iterated_ SUR?

Best wishes,
Arne

 2) Is there an easy possibility to test a) the OLS equations, and b) the
 SUR system for SUR structures? In other words: Is the LM-Test from
 Breusch and Pagan available in R?

 Thanks for the attention!

 Best Regards,
 Thomas Almer

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

-- 
Arne Henningsen
Department of Agricultural Economics
University of Kiel
Olshausenstr. 40
D-24098 Kiel (Germany)
Tel: +49-431-880 4445
Fax: +49-431-880 1397
[EMAIL PROTECTED]
http://www.uni-kiel.de/agrarpol/ahenningsen/

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


[R] Citation

2004-11-29 Thread Tatiana Fernandes
Hello!
 
I would like to know how do I citate R?
I have used it during my Master thesis but I don’t know how to citate
during the text and on the references.
I’ve looked for it on the web page but only found how to citate the FAQ.
 
Thank you in advance.
 
Tatiana Fernandes
Universidade Estadual do Norte Fluminense
Laboratório de Ciências Ambientais - CBB
Av. Alberto Lamego, 2.000 - Campos dos Goytacazes - RJ
28013-600 - BRASIL
Tel: +55 (22) 2726-1469
Fax: +55 (22) 2726-1472
e-mail:  mailto:[EMAIL PROTECTED]
[EMAIL PROTECTED]
 

[[alternative HTML version deleted]]

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


Re: [R] plot problem

2004-11-29 Thread Arne Henningsen
Hi William,

the 1st example given in ?screeplot works for me (R 2.0.0 on SuSE Linux 9.0):
 (pc.cr - princomp(USArrests, cor = TRUE))  # inappropriate
 screeplot(pc.cr)
plot appears

To help you we need more details. 
Does normal plotting work? e.g.: plot(rnorm(20),rnorm(20))
Can you plot to a file? (see ?ps, ?pdf or ?png and don't forget dev.off())

Arne

On Monday 29 November 2004 13:47, william ritchie wrote:
 Dear all,

 I am having trouble plotting a PCA result. The plot doesn't appear!!!
 R goes through without any errors but doesn't make a plot appear!!
 Could it be wrong window parameters? In this case how do I change them?
 I am under red hat 9 with the latest version of R!

 Thanks.

 Vous manquez d’espace pour stocker vos mails ?

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

-- 
Arne Henningsen
Department of Agricultural Economics
University of Kiel
Olshausenstr. 40
D-24098 Kiel (Germany)
Tel: +49-431-880 4445
Fax: +49-431-880 1397
[EMAIL PROTECTED]
http://www.uni-kiel.de/agrarpol/ahenningsen/

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


RE: [R] Citation

2004-11-29 Thread Andy Bunn
See the function ?citation under 2.0.0

R  citation()

To cite R in publications use:

  R Development Core Team (2004). R: A language and environment for
  statistical computing. R Foundation for Statistical Computing,
  Vienna, Austria. ISBN 3-900051-07-0, URL http://www.R-project.org.

HTH, Andy


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Tatiana Fernandes
 Sent: Monday, November 29, 2004 11:20 AM
 To: [EMAIL PROTECTED]
 Subject: [R] Citation


 Hello!

 I would like to know how do I citate R?
 I have used it during my Master thesis but I don’t know how to citate
 during the text and on the references.
 I’ve looked for it on the web page but only found how to citate the FAQ.

 Thank you in advance.

 Tatiana Fernandes
 Universidade Estadual do Norte Fluminense
 Laboratório de Ciências Ambientais - CBB
 Av. Alberto Lamego, 2.000 - Campos dos Goytacazes - RJ
 28013-600 - BRASIL
 Tel: +55 (22) 2726-1469
 Fax: +55 (22) 2726-1472
 e-mail:  mailto:[EMAIL PROTECTED]
 [EMAIL PROTECTED]


   [[alternative HTML version deleted]]

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


Re: [R] Citation

2004-11-29 Thread Chuck Cleland
  Did you see item 2.8 in the R FAQ?
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Citing-R
Tatiana Fernandes wrote:
Hello!
 
I would like to know how do I citate R?
I have used it during my Master thesis but I dont know how to citate
during the text and on the references.
Ive looked for it on the web page but only found how to citate the FAQ.
 
Thank you in advance.
 
Tatiana Fernandes
Universidade Estadual do Norte Fluminense
Laboratrio de Cincias Ambientais - CBB
Av. Alberto Lamego, 2.000 - Campos dos Goytacazes - RJ
28013-600 - BRASIL
Tel: +55 (22) 2726-1469
Fax: +55 (22) 2726-1472
e-mail:  mailto:[EMAIL PROTECTED]
[EMAIL PROTECTED]
 

[[alternative HTML version deleted]]
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
--
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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Citation

2004-11-29 Thread Uwe Ligges
Tatiana Fernandes wrote:
Hello!
 
I would like to know how do I citate R?
I have used it during my Master thesis but I dont know how to citate
during the text and on the references.
Ive looked for it on the web page but only found how to citate the FAQ.
Please the FAQ more carefully and find how it is cited therein. Or just type
  citation()
at the prompt.
Uwe Ligges


Thank you in advance.
 
Tatiana Fernandes
Universidade Estadual do Norte Fluminense
Laboratrio de Cincias Ambientais - CBB
Av. Alberto Lamego, 2.000 - Campos dos Goytacazes - RJ
28013-600 - BRASIL
Tel: +55 (22) 2726-1469
Fax: +55 (22) 2726-1472
e-mail:  mailto:[EMAIL PROTECTED]
[EMAIL PROTECTED]
 

[[alternative HTML version deleted]]
__
[EMAIL PROTECTED] mailing list
https://stat.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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Citation

2004-11-29 Thread susana barbosa

citation()

 Hello!

 I would like to know how do I citate R?
 I have used it during my Master thesis but I dont know how to citate
 during the text and on the references.
 Ive looked for it on the web page but only found how to citate the FAQ.

 Thank you in advance.

 Tatiana Fernandes
 Universidade Estadual do Norte Fluminense
 Laboratrio de Cincias Ambientais - CBB
 Av. Alberto Lamego, 2.000 - Campos dos Goytacazes - RJ
 28013-600 - BRASIL
 Tel: +55 (22) 2726-1469
 Fax: +55 (22) 2726-1472
 e-mail:  mailto:[EMAIL PROTECTED]
 [EMAIL PROTECTED]


   [[alternative HTML version deleted]]

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


Re: [R] Building latest version of package

2004-11-29 Thread Uwe Ligges
michael watson (IAH-C) wrote:
Hi
I have a package which was built using R 1.9.1 and everything worked
fine.  I recently upgraded to R 2.0.1 and tried to re-install my package
- and I got:
Error in library(mypackage) : 'mypackage' is not a valid package --
installed  2.0.0?
So I tried rebuilding it using my new version of R:
R CMD BUILD --binary mypackage
hhc: not found
cp: cannot stat `mypackage.chm': No such file or directory
make[1]: *** [chm-mypackage] Error 1
make: *** [pkg-mypackage] Error 2
*** Installation of mypackage failed ***
Removing 'f:/tmp/Rbuild.2972/mypackage'
 ERROR
* installation failed
I didn't have these problems before.  What is hhc and why can't R find
it?
hhc is Microsoft's compiled html help compiler. Either edit your MkRules 
file not to generate chm files, or download and install the required 
software as mentioned in file readme.packages.


In general, will I have to re-build my package everytime a new version
of R is released?
Well, not always, but yes, if considerable changes have taken place, as 
it has happend for the change from 1.y.z to 2.0.0.

Uwe Ligges


Many thanks
Mick
__
[EMAIL PROTECTED] mailing list
https://stat.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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Citation

2004-11-29 Thread Peter Dalgaard
Tatiana Fernandes [EMAIL PROTECTED] writes:

 Hello!
  
 I would like to know how do I citate R?
 I have used it during my Master thesis but I don’t know how to citate
 during the text and on the references.
 I’ve looked for it on the web page but only found how to citate the FAQ.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R in publications.


...and if you don't see that when you start R, you need to upgrade!

It is in the FAQ too (Q2.8).

-- 
   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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Citation

2004-11-29 Thread Liaw, Andy
 From: Chuck Cleland
 
Did you see item 2.8 in the R FAQ?
 
 http://cran.r-project.org/doc/FAQ/R-FAQ.html#Citing-R

Or the start-up message, which has, in part:

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Note that last line!

Andy

 
 Tatiana Fernandes wrote:
  Hello!
   
  I would like to know how do I citate R?
  I have used it during my Master thesis but I don't know how 
 to citate
  during the text and on the references.
  I've looked for it on the web page but only found how to 
 citate the FAQ.
   
  Thank you in advance.
   
  Tatiana Fernandes
  Universidade Estadual do Norte Fluminense
  Laboratório de Ciências Ambientais - CBB
  Av. Alberto Lamego, 2.000 - Campos dos Goytacazes - RJ
  28013-600 - BRASIL
  Tel: +55 (22) 2726-1469
  Fax: +55 (22) 2726-1472
  e-mail:  mailto:[EMAIL PROTECTED]
  [EMAIL PROTECTED]
   
  
  [[alternative HTML version deleted]]
  
  __
  [EMAIL PROTECTED] mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
  
 
 -- 
 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://stat.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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] scan; 1 items

2004-11-29 Thread Tiago R Magalhaes
HI
the scan function when only one item is read says:
scan()
1: 3.3
2:
Read 1 items
[1] 3.3
I hope my english is not playing a trick on me, but 1 items sounds 
very strange
this makes me feel very anal, and it's really not important and I 
apologize for it but here it goes anyway

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


Re: [R] Error using glm with poisson family and identity link

2004-11-29 Thread Thomas Lumley
On Thu, 25 Nov 2004, Peter Dalgaard wrote:
I haven't got all that much experience with it, but obviously, the
various algorithms for constrained optimization (box- or otherwise) at
least allow you to find a proper maximum likelihood estimator.

It's harder than it looks (well, my experience is with the log-binomial 
model, but it should be similar).  The constraints are not box 
constraints, but a more general set of linear constraints, and you either 
have to find the convex hull of the data or use a constraint for every 
data point.

Also, the algorithm in glm.fit, while not perfect, is a little smarter 
than a simple IRLS. It uses step-halving to back away from the edge, and 
when the parameter space is convex it has a reasonable chance of creeping 
along the boundary to the true MLE.

I think better glm fitting is worth pursuing: computational difficulties 
with the log-binomial model have forced many epidemiologists turn to 
estimators other than the MLE (or contrasts other than the relative risk), 
which is a pity.

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


Re: [R] PlotML

2004-11-29 Thread Gregoire Thomas

 Has anybody ever written some plot / hist functions that would return
 PlotML code? [http://ptolemy.eecs.berkeley.edu/] 
http://ptolemy.eecs.berkeley.edu/%5D

Not that I know of, and looking at the design of PlotML, it doesn't
look like a nice fit as an R device driver. PlotML works at the level
of data sets, bar graphs, axes, etc., not with low-level items like
lines, polygons, and text. There are general XML handling tools in the
XML package, though.
Thx. I've wrapped up a couple of functions into a package that does what 
I need. In case somebody is interested I've put it with an example at: 
http://penyfan.ugent.be/ptplot/ . Note that you might also need to 
install R2HTML.
Regards, Gregoire

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

Re: [R] Error using glm with poisson family and identity link

2004-11-29 Thread Peter Dalgaard
Thomas Lumley [EMAIL PROTECTED] writes:

 Also, the algorithm in glm.fit, while not perfect, is a little smarter
 than a simple IRLS. It uses step-halving to back away from the edge,
 and when the parameter space is convex it has a reasonable chance of
 creeping along the boundary to the true MLE.

Hmm. That wasn't my experience. I had a situation where there was like
a (virtual) maximum outside the boundary, and the algorithm would
basically stay on the path to that peak, banging its little head
into the same point of the wall repeatedly, so to speak.

(If you make a little drawing of an elliptical contour intersecting a
linear boundary, I'm sure you'll see that this process leads to a
point-of-no-progress that can be quite far from the maximum along the
edge.)

 
 I think better glm fitting is worth pursuing: computational
 difficulties with the log-binomial model have forced many
 epidemiologists turn to estimators other than the MLE (or contrasts
 other than the relative risk), which is a pity.

Yup...

-- 
   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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Question d'un débutant

2004-11-29 Thread Thomas Lumley
On Sun, 28 Nov 2004, HOME - Didier Ledoux wrote:
Je suis débutant en R. Je voudrais faire un tableau de statistiques 
descriptives ou les moyennes seraient calculées en fonction de deux critères: 
sexe, région
Cela donnerait ceci:
SEXEREGIONMOYENNE
femmeAmoy1
femmeBmoy2
HommeA  moy3
HommeB  moy4
Comment dois-je faire?
Quelles commandes utiliser?
?by
-thomas__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] escaping backslash in a string

2004-11-29 Thread Dan Lipsitt
How can I get a single backslash in a character string?

My goal is to escape dots in a string that will be used as a regular
expression. I thought I could do it this way:

gsub(., \\., x)

Unfortunately, \\ does not represent a literal backslash as I
expected, but rather a pair of backslashes:

 \\.
[1] \\.
 \\
[1] \\

Just a backslash and a dot fails too, since that represents an escaped dot:

 \.
[1] .

A single backslash works in the middle of strings sometimes,but it
depends on what the character following it is (presumably depending on
whether the pair of characters represents an escape sequence):

 a\b
[1] a\b
 x\y
[1] xy

Is there a way to represent \? This seems like a design problem in
the interpreter.

 R.version
 _
platform i386-redhat-linux-gnu
arch i386 
os   linux-gnu
system   i386, linux-gnu  
status
major2
minor0.1  
year 2004 
month11   
day  15   
language R

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


Re: [R] non-visible functions in return to methods()

2004-11-29 Thread Thomas Lumley
On Mon, 29 Nov 2004, steve houghton wrote:
Please point me to the documentation explaining why some of the functions 
returned
by calling methods() are marked as non-visible and whether there is indeed 
no way of
viewing the R code of such functions

Luke Tierney's article in Volume 3 No 1 of the R Newsletter explains why. 
How to get the functions is FAQ 7.26.

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


[R] library(fields) world shift function not working anymore

2004-11-29 Thread Jenny Fox
Hi there.

I just upgraded to 2.01 on Mac OS 10.3.6.  I used to use the command 
(on R 1.9.x):

world(ylim=c(-30,30), xlim = c(0,360), shift=TRUE, add=TRUE)

to draw a world outline over my image plots.  My data uses longitude 
from (0, 360) so I need to use the shift function.  After I upgraded, I 
get the following error:

  world(ylim=c(-30,30), xlim = c(0,360), shift=TRUE, add=TRUE)
Error in world(ylim = c(-30, 30), xlim = c(0, 360), shift = TRUE, add = 
TRUE) :
NAs are not allowed in subscripted assignments

Does anyone know a workaround for this?

Thank you.

Jennifer Fox
Graduate Researcher
NOAA Aeronomy Laboratory
Boulder, CO

[EMAIL PROTECTED]
[[alternative text/enriched version deleted]]

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


Re: [R] escaping backslash in a string

2004-11-29 Thread Peter Dalgaard
Dan Lipsitt [EMAIL PROTECTED] writes:

 How can I get a single backslash in a character string?
 
 My goal is to escape dots in a string that will be used as a regular
 expression. I thought I could do it this way:
 
 gsub(., \\., x)
 
 Unfortunately, \\ does not represent a literal backslash as I
 expected, but rather a pair of backslashes:
 
  \\.
 [1] \\.
  \\
 [1] \\

Nononononono If you want to know what is inside a string, use
cat() not (implicitly) print()

 cat( \\.)
\.

The thing is that print() itself escapes weird characters, including
the escape character:

 x - readLines() # ctr-D terminates (on Linux anyway)
\.
 x
[1] \\.


 Is there a way to represent \? This seems like a design problem in
 the interpreter.

Yes. Not at all.

-- 
   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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] problem with using transace

2004-11-29 Thread Frank E Harrell Jr
[EMAIL PROTECTED] wrote:
I am trying to use the Hmisc function transace to transform predictors
test-cbind(flowstress,pressres,alloy)
xtrans-transace(x,binary=pressres',monotonic='flowstress', categorical='alloy')
and I am getting the following message¨
Error in ace(x[, -i], x[, i], monotone = im, categorical = ic) : 
	unused argument(s) (monotone ...)

Any idea?

thanks anne
thank for your help
Anne
The corrected version (below) will fix that problem but note that there 
is a bug in ace causing it not to allow a monotonicity constraint when a 
variable is on the left hand side.  This is inconsistent with the ace 
documentation.  There are other problems in ace in which it checks 
column numbers against the number of rows in the x matrix instead of the 
number of columns.  The internal version of ace defined inside areg.boot 
fixes the latter problem.  Note that I reported these problems a long 
time ago.

Frank
transace - function(x, monotonic=NULL, categorical=NULL, binary=NULL, 
pl=TRUE) {
  if(.R.) require('acepack')  # provides ace, avas

nam - dimnames(x)[[2]]
omit - is.na(x %*% rep(1,ncol(x)))
omitted - (1:nrow(x))[omit]
if(length(omitted)) x - x[!omit,]
p - ncol(x)
xt - x  # binary variables retain original coding
if(!length(nam)) stop(x must have column names)
rsq - rep(NA, p)
names(rsq) - nam
for(i in (1:p)[!(nam %in% binary)]) {
  lab - nam[-i]
  w - 1:(p-1)
  im - w[lab %in% monotonic]
  ic - w[lab %in% categorical]
  if(nam[i] %in% monotonic) im - c(0, im)
  if(nam[i] %in% categorical) ic - c(0, ic)
  m - 10*(length(im)0)+(length(ic)0)
  if(m==11) a - ace(x[,-i], x[,i], mon=im, cat=ic)
  else if (m==10) a - ace(x[,-i], x[,i], mon=im)
  else if(m==1) a - ace(x[,-i], x[,i], cat=ic)
  else a - ace(x[,-i], x[,i])
  xt[,i] - a$ty
  rsq[i] - a$rsq
  if(pl)plot(x[,i], xt[,i], xlab=nam[i], ylab=paste(Transformed,nam[i]))
}   
cat(R-squared achieved in predicting each variable:\n\n)
print(rsq)
attr(xt, rsq) - rsq
attr(xt, omitted) - omitted
invisible(xt)
}


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

--
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Seeking help with a simple loop construction

2004-11-29 Thread Greg Blevins
Hello,

I have a df, pp, with five variables:

 nobs(pp)
  q10_1   q10_2   q10_3   q10_4 actcode 
   16201620162016201620 

I want to create a loop to run four xtabs (the first four variables above by 
the fifth) and then store the results in a matrix.  Below I make my intent 
clear by showing the output of one xtab which is inserted into a matrix.

 a - xtabs(q10_1 ~ actcode)
 a
actcode
 1  2  3  4  5  6  7  8  9 10 
 7 11  3 60 66 56 21 40  7  8 

 freq.mat - matrix(0, 4, 10, byrow = TRUE)
 freq.mat[1,] - a
 freq.mat
 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]7   113   60   66   56   21   407 8
[2,]000000000 0
[3,]000000000 0
[4,]000000000 0
===
I have spent a couple of hours searching the web and my texts but continue to 
strike out in my attempts to construct a correct formulation of this simple 
loop. Help would be appreciated.

Greg Blevins
The Market Solutions Group, Inc.
Windows XP
R 2.0.1
Pentium 4
512 memory

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


[R] Log(2) values to log(10) values

2004-11-29 Thread Srinivas Iyyer
Dear group, 
 I am using justRMA in bioconductor to get expression
values.  Now I computed fold changes.  the fold
changes i get are log2 values.  

How can I convert these to log10 values to see them as
actual fold change values. 

thank you.

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


Re: [R] escaping backslash in a string

2004-11-29 Thread Dan Lipsitt
Ah, I see. Thanks. ?print.default and ?cat do not mention this.

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


RE: [R] Log(2) values to log(10) values

2004-11-29 Thread Liaw, Andy
Multiply by log(2)/log(10); e.g., 

 log2(1024) * log(2)/log(10)
[1] 3.0103
 log(1024, 10)
[1] 3.0103

Andy

 From: Srinivas Iyyer
 
 Dear group, 
  I am using justRMA in bioconductor to get expression
 values.  Now I computed fold changes.  the fold
 changes i get are log2 values.  
 
 How can I convert these to log10 values to see them as
 actual fold change values. 
 
 thank you.
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Log(2) values to log(10) values

2004-11-29 Thread Peter Dalgaard
Srinivas Iyyer [EMAIL PROTECTED] writes:

 Dear group, 
  I am using justRMA in bioconductor to get expression
 values.  Now I computed fold changes.  the fold
 changes i get are log2 values.  
 
 How can I convert these to log10 values to see them as
 actual fold change values. 

Divide by log2(10) or multiply by log10(2).

-- 
   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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Seeking help with a simple loop construction

2004-11-29 Thread Andy Bunn
Does this do what you want?

foo.df - data.frame(x = rnorm(12), y = runif(12), z = factor(rep(1:3,4)))
bar.mat - matrix(NA,  nrow = ncol(foo.df)-1, ncol = nlevels(foo.df$z))
for(i in 1:(ncol(foo.df)-1))
{
bar.mat[i,] - xtabs(foo.df[,i] ~ foo.df$z)
}
bar.mat

There's probably a slicker way with apply...

HTH, Andy

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Greg Blevins
 Sent: Monday, November 29, 2004 1:09 PM
 To: [EMAIL PROTECTED]
 Subject: [R] Seeking help with a simple loop construction
 
 
 Hello,
 
 I have a df, pp, with five variables:
 
  nobs(pp)
   q10_1   q10_2   q10_3   q10_4 actcode 
16201620162016201620 
 
 I want to create a loop to run four xtabs (the first four 
 variables above by the fifth) and then store the results in a 
 matrix.  Below I make my intent clear by showing the output of 
 one xtab which is inserted into a matrix.
 
  a - xtabs(q10_1 ~ actcode)
  a
 actcode
  1  2  3  4  5  6  7  8  9 10 
  7 11  3 60 66 56 21 40  7  8 
 
  freq.mat - matrix(0, 4, 10, byrow = TRUE)
  freq.mat[1,] - a
  freq.mat
  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]7   113   60   66   56   21   407 8
 [2,]000000000 0
 [3,]000000000 0
 [4,]000000000 0
 ===
 I have spent a couple of hours searching the web and my texts but 
 continue to strike out in my attempts to construct a correct 
 formulation of this simple loop. Help would be appreciated.
 
 Greg Blevins
 The Market Solutions Group, Inc.
 Windows XP
 R 2.0.1
 Pentium 4
 512 memory
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Log(2) values to log(10) values

2004-11-29 Thread James W. MacDonald
Srinivas Iyyer wrote:
Dear group, 
 I am using justRMA in bioconductor to get expression
values.  Now I computed fold changes.  the fold
changes i get are log2 values.  

How can I convert these to log10 values to see them as
actual fold change values. 
First, a bit of etiquette. It is considered impolite to post the same 
question to more than one listserv. Second, although this is not a 
BioC-specific question, that is probably a better place to ask.

To answer; log10 values will *not* give you actual fold changes. These 
will be the same as log2, to a multiplicitive constant. You want to 
convert back to the natural scale e.g., 2^FC, where FC = your fold changes.

Also note that you compute fold change on the log scale by subtraction, 
not division.

HTH,
Jim

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

--
James W. MacDonald
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Call to trellis.focus(); thenpanel.superpose()

2004-11-29 Thread Paul Murrell
Hi
Deepayan Sarkar wrote:
On Monday 29 November 2004 04:46, John Maindonald wrote:
The following works fine with the x11 device, though it
may well be that an initial plot is overwritten.  With a pdf
or postscript device, I get two plots, the first of which
still has the red border from having the focus, while the
second is the plot that I want.
library(lattice); library(grid)
plt - xyplot(uptake ~ conc, groups=Plant, data=CO2)
print(plt)
trellis.focus(panel, row=1, column=1)
arglist=trellis.panelArgs()
arglist$type - l
do.call(panel.superpose, args=arglist)
trellis.unfocus()
Should I be able to use panel.superpose() in this way?

Yes. The red border should be 'removed', but that's done by grid.remove 
and maybe it doesn't work on PDF devices.

It works, but it works by removing the red rectangle from the list of 
objects representing the scene and then redrawing the scene, hence a new 
page.

Paul

The solution is to use 

trellis.focus(panel, row=1, column=1, highlight = FALSE)
(which happens automatically for non-interactive sessions).

The new abilities provided by trellis.focus() etc add
greatly to the flexibility of what can be done with lattice
plots.  The grid-lattice combination is a great piece of
software.

Yes, it can be especially useful for tasks similar to identify(). 
Everything else can probably be done by clever enough use of the panel 
function (though perhaps not as naturally).

Deepayan
__
[EMAIL PROTECTED] mailing list
https://stat.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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] (no subject)

2004-11-29 Thread stephenc
Hi 
 
I am trying to tune an svm by doing the following:
 
tune(svm, similarity ~., data = training, degree = 2^(1:2), gamma =
2^(-1:1), coef0 = 2^(-1:1), cost = 2^(2:4), type = polynomial)
 
but I am getting 
 
Error in svm.default(x, y, scale = scale, ...) : 
wrong type specification!

 
I have to admit I am not sure what I am doing wrong.  Could anyone tell
me why the parameters I am using are wrong? 
 
Plus could anyone tell me how to go about picking the correct ranges for
my tuning?
 
Thanks
 
S

[[alternative HTML version deleted]]

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


Re: [R] escaping backslash in a string

2004-11-29 Thread Dan Lipsitt
I have it working now, I think. Since it's going into a regular
expression, I have to escape each of the escape characters, resulting
in four backslashes altogether:

 sub([.], x, a.b)
[1] axb
 sub([.], \., a.b)
[1] a.b
 sub([.], \\., a.b)
[1] a.b
 sub([.], \\\., a.b)
[1] a.b
 sub([.], ., a.b)
[1] a\\.b
 cat(sub([.], ., a.b))
a\.b

or

 cat(sub(\\., ., a.b))
a\.b 

Dan

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


[R] Re: Reasons not to answer very basic questions...

2004-11-29 Thread Jim Lemon
A.J. Rossini wrote:

 and perhaps the most important reason for the particular socratic form
 of teaching on this list...

Golly, anyone who read Plato's Dialogues would realize that the Socratic 
method involves patiently leading the questioner stepwise through the 
solution, not simply writing RTFMeno.

Jim

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


Re: [R] library(fields) world shift function not working anymore

2004-11-29 Thread Ray Brownrigg
 I just upgraded to 2.01 on Mac OS 10.3.6.  I used to use the command 
 (on R 1.9.x):
 
 world(ylim=c(-30,30), xlim = c(0,360), shift=TRUE, add=TRUE)
 
 to draw a world outline over my image plots.  My data uses longitude 
 from (0, 360) so I need to use the shift function.  After I upgraded, I 
 get the following error:
 
   world(ylim=c(-30,30), xlim = c(0,360), shift=TRUE, add=TRUE)
 Error in world(ylim = c(-30, 30), xlim = c(0, 360), shift = TRUE, add = 
 TRUE) :
   NAs are not allowed in subscripted assignments
 
 Does anyone know a workaround for this?
 
Well, a workaround would be:
library(maps)
map(world2, ylim=c(-30,30), xlim = c(0,360), add = TRUE)

(at least until fields is updated).

CHANGES IN R VERSION 2.0.0

o   Subassignments involving NAs and with a replacement value of
length  1 are now disallowed.  (They were handled
inconsistently in R  2.0.0, see PR#7210.)  For data frames
they are disallowed altogether, even for logical matrix indices
(the only case which used to work).

Ray Brownrigg

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


[R] tune()

2004-11-29 Thread stephenc
Hi 
 
I am trying to tune an svm by doing the following:
 
tune(svm, similarity ~., data = training, degree = 2^(1:2), gamma =
2^(-1:1), coef0 = 2^(-1:1), cost = 2^(2:4), type = polynomial)
 
but I am getting 
 
Error in svm.default(x, y, scale = scale, ...) : 
wrong type specification!

 
I have to admit I am not sure what I am doing wrong.  Could anyone tell
me why the parameters I am using are wrong? 
 
Plus could anyone tell me how to go about picking the correct ranges for
my tuning?
 
Thanks
 
S

[[alternative HTML version deleted]]

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


Re: [R] tune()

2004-11-29 Thread Achim Zeileis
Sending a help request once is enough! Even if you don't have an answer
after 1 hour.

 I am trying to tune an svm by doing the following:
  
 tune(svm, similarity ~., data = training, degree = 2^(1:2), gamma =
 2^(-1:1), coef0 = 2^(-1:1), cost = 2^(2:4), type = polynomial)

I think you want to set `kernel' not `type'...
  
 but I am getting 
  
 Error in svm.default(x, y, scale = scale, ...) : 
 wrong type specification!

...checking the argument `type' on ?svm would have told you that.

 I have to admit I am not sure what I am doing wrong.  Could anyone
 tell me why the parameters I am using are wrong? 

 Plus could anyone tell me how to go about picking the correct ranges
 for my tuning?

Surprisingly, you have to set `ranges' to specify the ranges of the
parameters, e.g.,

  obj - tune(svm, Species ~ ., data = iris,
  ranges = list(degree =2^(1:2), gamma = 2^(-1:1),
coef0 = 2^(-1:1), cost = 2^(2:4)),
  kernel = polynomial)

I'm not sure what good ranges are to tune an SVM with a polynomial
kernel...

hth,
Z

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


Re: [R] escaping backslash in a string

2004-11-29 Thread Gabor Grothendieck
Dan Lipsitt danlipsitt at gmail.com writes:

: 
: I have it working now, I think. Since it's going into a regular
: expression, I have to escape each of the escape characters, resulting
: in four backslashes altogether:
: 
:  sub([.], x, a.b)
: [1] axb
:  sub([.], \., a.b)
: [1] a.b
:  sub([.], \\., a.b)
: [1] a.b
:  sub([.], \\\., a.b)
: [1] a.b
:  sub([.], ., a.b)
: [1] a\\.b
:  cat(sub([.], ., a.b))
: a\.b
: 
: or
: 
:  cat(sub(\\., ., a.b))
: a\.b 
: 

You can use \134 in place of the double backslash 
if that makes more sense to you.  

Another possibility is to create a variable 
   backslash - \\ 
and paste together each string in terms of that variable.

Also its sometimes helpful to use nchar(s) on string s
just to check how many characters it has.

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


[R] [BASIC] Solution of creating a sequence of object names

2004-11-29 Thread John
Dear R-users,

I state that this is for beginners, so you may ignore
this in order not to be irritated.

By the way, patience is another important thing,
together with kindness, we should keep in mind when
we teach students and our own children as Jim Lemon
pointed out well in the context of the Socratic
method. You may know that being kind does not mean 
giving spoonfed answers to questioners.

-

I was asked for the solution of my problem, and a
couple of answers were given to me in private emails.
I am not sure if it was a mere accident. I post them
now, without their permission, for those who are
interested in learning them. So if you're happy to
know the solution, thanks should go to the person
concerned. I thank all the three people named below.

(1) my solution after reading the R-FAQ 7.21 as Uwe
Ligges pointed out

 for ( i in 1:10 ) {
+ assign(paste(my.file., i, sep=), NULL)
+ }


(2) Adai Ramasamy's solution

 for(obj in paste(my.ftn, 1:10, sep=))
assign(obj, NULL)
 
### or 
 
 for(i in 1:10) assign(paste(my.ftn, i, sep=),
NULL)


(3) James Holtman's solution

# For example, if you want to generate 10 groups 
# of 5 random numbers and store them 
# under then names GRPn where n is 1 - 10, 
# the following can be used:
#
 Result - list()  # create the list
 for (i in 1:10) Result[[paste(GRP, i, sep='')]] -
runif(5)   # store each result
 Result# print out the data
$GRP1
[1] 0.2655087 0.3721239 0.5728534 0.9082078 0.2016819

$GRP2
[1] 0.89838968 0.94467527 0.66079779 0.62911404
0.06178627

$GRP3
[1] 0.2059746 0.1765568 0.6870228 0.3841037 0.7698414

$GRP4
[1] 0.4976992 0.7176185 0.9919061 0.3800352 0.7774452

$GRP5
[1] 0.9347052 0.2121425 0.6516738 0.121 0.2672207

$GRP6
[1] 0.38611409 0.01339033 0.38238796 0.86969085
0.34034900

$GRP7
[1] 0.4820801 0.5995658 0.4935413 0.1862176 0.8273733

$GRP8
[1] 0.6684667 0.7942399 0.1079436 0.7237109 0.4112744

$GRP9
[1] 0.8209463 0.6470602 0.7829328 0.5530363 0.5297196

$GRP10
[1] 0.78935623 0.02333120 0.47723007 0.73231374
0.69273156



Regards,

John

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


RE: [R] [BASIC] Solution of creating a sequence of object names

2004-11-29 Thread bogdan romocea
You may be missing something. After you create all those objects,
you'll want to use them. Use get():
for (i in 1:10) ... get(paste(object,i,sep=)) ... 
It took me about a week to find out how to do this. I waited for a
few days, but before I got to ask this basic/rtfm question, someone
else - fortunately :-) - did.

HTH,
b.


-Original Message-
From: John [mailto:[EMAIL PROTECTED]
Sent: Monday, November 29, 2004 4:03 PM
To: [EMAIL PROTECTED]
Subject: [R] [BASIC] Solution of creating a sequence of object names


Dear R-users,

I state that this is for beginners, so you may ignore
this in order not to be irritated.

By the way, patience is another important thing,
together with kindness, we should keep in mind when
we teach students and our own children as Jim Lemon
pointed out well in the context of the Socratic
method. You may know that being kind does not mean 
giving spoonfed answers to questioners.

-

I was asked for the solution of my problem, and a
couple of answers were given to me in private emails.
I am not sure if it was a mere accident. I post them
now, without their permission, for those who are
interested in learning them. So if you're happy to
know the solution, thanks should go to the person
concerned. I thank all the three people named below.

(1) my solution after reading the R-FAQ 7.21 as Uwe
Ligges pointed out

 for ( i in 1:10 ) {
+ assign(paste(my.file., i, sep=), NULL)
+ }


(2) Adai Ramasamy's solution

 for(obj in paste(my.ftn, 1:10, sep=))
assign(obj, NULL)
 
### or 
 
 for(i in 1:10) assign(paste(my.ftn, i, sep=),
NULL)


(3) James Holtman's solution

# For example, if you want to generate 10 groups 
# of 5 random numbers and store them 
# under then names GRPn where n is 1 - 10, 
# the following can be used:
#
 Result - list()  # create the list
 for (i in 1:10) Result[[paste(GRP, i, sep='')]] -
runif(5)   # store each result
 Result# print out the data
$GRP1
[1] 0.2655087 0.3721239 0.5728534 0.9082078 0.2016819

$GRP2
[1] 0.89838968 0.94467527 0.66079779 0.62911404
0.06178627

$GRP3
[1] 0.2059746 0.1765568 0.6870228 0.3841037 0.7698414

$GRP4
[1] 0.4976992 0.7176185 0.9919061 0.3800352 0.7774452

$GRP5
[1] 0.9347052 0.2121425 0.6516738 0.121 0.2672207

$GRP6
[1] 0.38611409 0.01339033 0.38238796 0.86969085
0.34034900

$GRP7
[1] 0.4820801 0.5995658 0.4935413 0.1862176 0.8273733

$GRP8
[1] 0.6684667 0.7942399 0.1079436 0.7237109 0.4112744

$GRP9
[1] 0.8209463 0.6470602 0.7829328 0.5530363 0.5297196

$GRP10
[1] 0.78935623 0.02333120 0.47723007 0.73231374
0.69273156



Regards,

John

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


[R] Kernel Fisher Discriminant in R?

2004-11-29 Thread Huh, Seungho
Dear members,

 

I am wondering if there are any functions to perform the Kernel Fisher
Discriminant method, especially for multi-class problems, in R. I would
appreciate any kind of information on this.

 

Thanks for your time.

 

Seungho Huh, Ph.D.

Research Statistician

RTI International

North Carolina, USA

 


[[alternative HTML version deleted]]

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


RE: [R] [BASIC] Solution of creating a sequence of object names

2004-11-29 Thread John
It was enough for me to use the 'assign' function
alone. But I'll remember the 'get' function for future
reference. Thanks a lot for the note.

John
 

 --- bogdan romocea [EMAIL PROTECTED] wrote: 
 You may be missing something. After you create all
 those objects,
 you'll want to use them. Use get():
 for (i in 1:10) ... get(paste(object,i,sep=))
 ... 
 It took me about a week to find out how to do this.
 I waited for a
 few days, but before I got to ask this basic/rtfm
 question, someone
 else - fortunately :-) - did.
 
 HTH,
 b.
 
 
 -Original Message-
 From: John [mailto:[EMAIL PROTECTED]
 Sent: Monday, November 29, 2004 4:03 PM
 To: [EMAIL PROTECTED]
 Subject: [R] [BASIC] Solution of creating a sequence
 of object names
 
 
 Dear R-users,
 
 I state that this is for beginners, so you may
 ignore
 this in order not to be irritated.
 
 By the way, patience is another important thing,
 together with kindness, we should keep in mind
 when
 we teach students and our own children as Jim Lemon
 pointed out well in the context of the Socratic
 method. You may know that being kind does not mean 
 giving spoonfed answers to questioners.
 
 -
 
 I was asked for the solution of my problem, and a
 couple of answers were given to me in private
 emails.
 I am not sure if it was a mere accident. I post them
 now, without their permission, for those who are
 interested in learning them. So if you're happy to
 know the solution, thanks should go to the person
 concerned. I thank all the three people named below.
 
 (1) my solution after reading the R-FAQ 7.21 as Uwe
 Ligges pointed out
 
  for ( i in 1:10 ) {
 + assign(paste(my.file., i, sep=), NULL)
 + }
 
 
 (2) Adai Ramasamy's solution
 
  for(obj in paste(my.ftn, 1:10, sep=))
 assign(obj, NULL)
  
 ### or 
  
  for(i in 1:10) assign(paste(my.ftn, i, sep=),
 NULL)
 
 
 (3) James Holtman's solution
 
 # For example, if you want to generate 10 groups 
 # of 5 random numbers and store them 
 # under then names GRPn where n is 1 - 10, 
 # the following can be used:
 #
  Result - list()  # create the list
  for (i in 1:10) Result[[paste(GRP, i, sep='')]]
 -
 runif(5)   # store each result
  Result# print out the data
 $GRP1
 [1] 0.2655087 0.3721239 0.5728534 0.9082078
 0.2016819
 
 $GRP2
 [1] 0.89838968 0.94467527 0.66079779 0.62911404
 0.06178627
 
 $GRP3
 [1] 0.2059746 0.1765568 0.6870228 0.3841037
 0.7698414
 
 $GRP4
 [1] 0.4976992 0.7176185 0.9919061 0.3800352
 0.7774452
 
 $GRP5
 [1] 0.9347052 0.2121425 0.6516738 0.121
 0.2672207
 
 $GRP6
 [1] 0.38611409 0.01339033 0.38238796 0.86969085
 0.34034900
 
 $GRP7
 [1] 0.4820801 0.5995658 0.4935413 0.1862176
 0.8273733
 
 $GRP8
 [1] 0.6684667 0.7942399 0.1079436 0.7237109
 0.4112744
 
 $GRP9
 [1] 0.8209463 0.6470602 0.7829328 0.5530363
 0.5297196
 
 $GRP10
 [1] 0.78935623 0.02333120 0.47723007 0.73231374
 0.69273156
 
 
 
 Regards,
 
 John
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html
 
 
 
   
   
 __ 
 Do you Yahoo!? 

 http://promotions.yahoo.com/new_mail


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


[R] Labeling charts within a loop

2004-11-29 Thread Doran, Harold
Hi All:

This may turn out to be very simply, but I can't seem to add the name of
the school to a chart. The loop I created is below that subsets a
dataframe and creates a chart for each school based on certain
variables. As it stands now, they title includes the school's ID number.
Instead, I want to replace this with the school's actual name, which is
stored in a variable called schname.

But so far, my attempts have been messy and ugly? Can anyone see a
mistake in my code?

Thanks,
Harold




#This portion of code takes the subset
school.list-as.vector(unique(mansfield.dat$schirn))
for(school.number in school.list){
assign(paste(school, school.number, sep=),
subset(mansfield.dat,mansfield.dat$schirn==school.number))}


for(school.number in school.list){
AV-mean(get(paste(school,school.number,sep=))[[bpra3ccf]])
RP-mean(get(paste(school,school.number,sep=))[[bprr3ccf]])
LT-mean(get(paste(school,school.number,sep=))[[bprl3ccf]])
IT-mean(get(paste(school,school.number,sep=))[[bpri3ccf]])


strengthbar-cbind(AV,RP,LT,IT)

pdf(paste(school,school.number,rel, .pdf,sep=))
barplot(strengthbar,names=c(AV, RP, LT,
IT),width=c(.5,.5,.5,.5),ylim = c(0, 4),col=(salmon))
legend(1.0,3.8,legend=c(1=Relative Weakness, 2=Similar to District,
3=Relative Strength))



title(main=(paste(Grade 3 Relative Strengths and Weaknesses, \n,
School , school.number,sep=)))


dev.off()

}

[[alternative HTML version deleted]]

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


Re: [R] Labeling charts within a loop

2004-11-29 Thread Peter Dalgaard
Doran, Harold [EMAIL PROTECTED] writes:

 Hi All:
 
 This may turn out to be very simply, but I can't seem to add the name of
 the school to a chart. The loop I created is below that subsets a
 dataframe and creates a chart for each school based on certain
 variables. As it stands now, they title includes the school's ID number.
 Instead, I want to replace this with the school's actual name, which is
 stored in a variable called schname.
 
 But so far, my attempts have been messy and ugly? Can anyone see a
 mistake in my code?

No overt mistakes, but multiple infelicities. Don't listen to guys who
want to create sequences of variable names, it is (almost) invariably
the wrong idea.

 #This portion of code takes the subset
 school.list-as.vector(unique(mansfield.dat$schirn))
 for(school.number in school.list){
 assign(paste(school, school.number, sep=),
 subset(mansfield.dat,mansfield.dat$schirn==school.number))}

Lessee, that was basically

byschool - split(mansfield.dat, mansfield.dat$schirn) 

below, you use only 4 variables from the data frame and under
different names, so maybe first extract and rename them and have

#--
# code should be executable from here on

vars - c(bpra3ccf, bprr3ccf, bprl3ccf, bpri3ccf)
d2 - mansfield.dat[vars]
names(d2) - c(AV, RP, LT, IT)
byschool - split(d2, mansfield.dat$schirn)

# now to get the averages, you can do

mnList - lapply(byschool, colMeans)

# now, let's do a little function to do one of your plots. It will have
# three arguments, the mean vector, the number of the school, and the
# name of the school

doPlot - function(mn, no, name)
{
   # (I won't argue with your filename scheme)
   pdf(file=paste(school, no, rel.pdf, sep=)
   # The barplot should get the names right automagically now:
   barplot(mn, width=c(.5,.5,.5,.5), ylim = c(0, 4), col=(salmon))
   legend(1.0,3.8,legend=c(1=Relative Weakness, 
2=Similar to District, 3=Relative Strength))
   title(main=(paste(Grade 3 Relative Strengths and Weaknesses, \n,
  School:, name, sep=)))
  
dev.off()
}

# All set, now

num - names(mnList)
mapply(doPlot, mnList, num, schname[num])

# done! End executable code
#--

Obviously, not having your data, all the above is untested, and most
likely not entirely bugfree.

 
 for(school.number in school.list){
 AV-mean(get(paste(school,school.number,sep=))[[bpra3ccf]])
 RP-mean(get(paste(school,school.number,sep=))[[bprr3ccf]])
 LT-mean(get(paste(school,school.number,sep=))[[bprl3ccf]])
 IT-mean(get(paste(school,school.number,sep=))[[bpri3ccf]])
 
 
 strengthbar-cbind(AV,RP,LT,IT)
 
 pdf(paste(school,school.number,rel, .pdf,sep=))
 barplot(strengthbar,names=c(AV, RP, LT,
 IT),width=c(.5,.5,.5,.5),ylim = c(0, 4),col=(salmon))
 legend(1.0,3.8,legend=c(1=Relative Weakness, 2=Similar to District,
 3=Relative Strength))
 
 
 
 title(main=(paste(Grade 3 Relative Strengths and Weaknesses, \n,
 School , school.number,sep=)))
 
 
 dev.off()
 
 }


-- 
   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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: Reasons not to answer very basic questions in a straightforward way; was: Re: [R] creating a sequence of object names

2004-11-29 Thread Mulholland, Tom
Your statement seems innocent enough on the face of it, but there are two 
facets that I think are worthy of note.

The first is that of time, and more specifically who's time. As a user of other 
lists I can say that this is the best list in terms of getting the answer to my 
problem, albeit sometime's obliquely. I intermittently respond to questions 
generally of the type you refer to. I say intermittently because I don't have 
the time to do more than that. Why do I respond to these questions? Well I made 
some of the same basic errors. As a much more knowledgeable user, I think twice 
(well more like six times) before I post because I understand the amount of 
time it takes to create a response that is worthwhile. I'll get to the reason 
for not creating simple answers in the next point. If I had to pay for the 
quality of support that I get on this list, there is no way that I could 
afford it. I take what I get and I am grateful for the time given by so many. 
To assume that my time is more important than those who will give me the answer 
is disrespectful.

Secondly is a process referred to as crowding out. With reference to the list 
there is a danger that it would cease to be a source of wisdom and start being 
a repetitive FAQ. As the list stands now I learn much more from other people's 
questions than I do from my own. I read about different ways of approaching 
various tasks and while I barely comprehend some of the more difficult 
questions they provoke my curiosity. I can read an FAQ anytime, I can read all 
of the manuals, they won't go away. At the moment the list is full of variation 
with the odd thread like this, which sparks more of a philosophical content. If 
90% of the list was full of questions that are tiresome because of dullness 
or more succinctly tedious, why would I continue to either ask questions of 
it or respond to them. In essence what I find useful on the list would be 
crowded out by repetitive questions. 

Experience has shown me that where you have a demand for quick solutions from 
people busy getting on with their lives, it can overwhelm your own life. One 
such experience happened  the last time I was in London, I happened to be 
standing next to one of those little currency exchange booths waiting for a 
friend. I heard some people having trouble working out where the British Museum 
was. I gave them some help. It was only after a while that I thought to start 
counting how many requests I received (well I was on Tottenham Court Rd) but 
eventually I counted 35. One can maintain that sort of help for a while, but I 
couldn't stand there all day. I was abused by a couple for eventually leaving 
and not answering their question. I know there are users of R who will not use 
the mailing list because they are intimidated by the manner of the list, but 
the users I have talked to acknowledge that they are looking for an easy 
solution and are not interested in contributing to the list. Th!
 ey have also pointed out that they can see why the list does what it does.

I get the feeling that a lot of subscribers to this list would understand where 
you are coming from, even though they may not look at the list the same way 
that you do. The bottom line is that I have had a reply to every question that 
I have put on the list and those replies have always helped me to solve my 
problem. Show that you've put some effort in and people will match that effort 
and more*. Your note had effort and consequently was treated as meritorious, 
although the answers may not have been what you wished.

Tom Mulholland


* K9, Dr Who, BBC Television
-Original Message-
...
I know very well that it is basic manners to read
those materials before asking questions here, but you
should also understand that people sometimes get stuck
with very simple problems if they are driven by stress
or run down. They can save a lot of time and
concentrate on and develop their primary jobs instead.
And I don't think you should be worried about 900
silly questions out of 1000 messages posted because
they are at least well-educated people who know what
reading basic materials before posting questions
means.

...

I beg your pardon if this message is not relevant to
this help list.

With kind regards,

John


 --- Uwe Ligges [EMAIL PROTECTED]
wrote: 
 John wrote:
  Thank you, Uwe. I've found a way to do the job by
  reading the FAQ 7.21 although it is not giving a
  precise explanation to a novice or casual user at
  first reading. For example, if you type the first
 two
 
 But the corresponding help files do so, for sure,
 and the FAQ 7.21 
 points you to ?assign and ?get.
 
 
  lines in the FAQ, you get an error as you do not
 have
  the variable, a, initially.
 
  I am sure that more and more people get interested
 in
  and serious about using R if advanced users are
 kind
  enough to answer simple and silly questions as
 well
  which are already explained in basic
 documentations.
  Or is this 

RE: [R] Tetrachoric and polychoric ceofficients (for sem) - any tips?

2004-11-29 Thread John Fox
Dear Michael,

I had some time this evening, so I programmed the two-step procedure
described in the article that I mentioned. This isn't the ML estimate of the
correlation, but apparently it performs reasonably well and it is quite
fast. I checked the function on some examples and it appears to work
correctly. I'd be curious to see how the this function compares with the one
that you received.

A more complete solution would take a data frame and, as appropriate,
calculate polychoric, polyserial, and product-moment correlations among its
columns. I don't think that writing a polyserial-correlation function would
be any more difficult. Perhaps I'll add this to the sem package; I hesitate
to do so because the resulting standard errors and likelihoods from sem()
won't be right.

I'm taking the liberty of copying this reply to the r-help list, since the
question was originally raised there. I hope that's OK.

Regards,
 John 


-- snip 

polychor - function (x, y){
# x: a contingency table of counts or an ordered categorical variable
# y: if x is a variable, a second ordered categorical variable
# returns the polychoric correlation for the table
#  or between x and y, using the two-step approximation
#  to the ML estimate described in F. Drasgow, Polychoric and
#  polyserial correlations, in S. Kotz and N. Johnson, eds.
#  The Encyclopedia of Statistics, Volume 7, New York: Wiley,
#  1986.
  f - function(rho) {
P - matrix(0, r, c)
R - matrix(c(1, rho, rho, 1), 2, 2)
for (i in 1:r){
  for (j in 1:c){
P[i,j] - pmvnorm(lower=c(row.cuts[i], col.cuts[j]),
  upper=c(row.cuts[i+1], col.cuts[j+1]),
  corr=R)
}
  }
 - sum(tab * log(P))
}
  tab - if (missing(y)) x else table(x, y)
  r - nrow(tab)
  c - ncol(tab)
  n - sum(tab)
  row.cuts - c(-Inf, qnorm(cumsum(rowSums(tab))/n))
  col.cuts - c(-Inf, qnorm(cumsum(colSums(tab))/n))
  optimise(f, interval=c(0, 1))$minimum
  }


 -Original Message-
 From: Michael Dewey [mailto:[EMAIL PROTECTED] 
 Sent: Monday, November 29, 2004 1:38 PM
 To: John Fox
 Subject: RE: [R] Tetrachoric and polychoric ceofficients (for 
 sem) - any tips?
 
 At 18:07 28/11/04, you wrote:
 Dear Michael,
 
 I'm not aware of pre-existing R code for tetrachoric or polychoric 
 correlations. I may at some point incorporate such functions 
 into the 
 sem package but I don't have concrete plans for doing so. On 
 the other 
 hand, I don't think that it would be very hard to do so. (A 
 discussion, 
 references, and an example are in Kotz and Johnson, eds., 
 Encyclopedia 
 of Statistics, Vol 7.)
 
 Someone has kindly emailed me some code for the polychoric 
 case (which he says is quite slow) I will try it out, it may 
 be better to treat the 2 by 2 case separately. If it is OK I 
 plan to write an equivalent to cor for matrices of 
 tetrachoric/polychoric. It will not happen any time soon now, 
 but if I do manage t would you be interested in it for sem? 
 As you say there remains the problem that they are estimates 
 and introduce further uncertainties.
 
 
 Tetrachoric and polychoric correlations are estimates, and in 
 subsequently estimating a SEM from these, one should take 
 that into account.
 
 Michael Dewey
 [EMAIL PROTECTED]


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


Re: [R] Error using glm with poisson family and identity link

2004-11-29 Thread Duncan Murdoch
On 29 Nov 2004 18:07:40 +0100, Peter Dalgaard
[EMAIL PROTECTED] wrote:

 I had a situation where there was like
a (virtual) maximum outside the boundary, and the algorithm would
basically stay on the path to that peak, banging its little head
into the same point of the wall repeatedly, so to speak.

I love that image:  the little optimizer that couldn't.

I hope the fortunes maintainer is listening...

Duncan Murdoch

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


[R] How to plot a 3D picture

2004-11-29 Thread Peter Yang
Hi, 

 

Suppose I have a 4 by 4 matrix as following:

 

10 6 3 1

 8 4 3 2

 6 2 4 3

 9 3 4 2

 

The x axis is the column index of the matrix, the y axis is the row index of 
the matrix and the z axis is the value in the corresponding position of the 
matrix. 

I tried to use contour and image. They are not the ones I want. 

 

You help is greatly appreciated. 

 

Peter

 

 

[[alternative HTML version deleted]]

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


Re: [R] How to plot a 3D picture

2004-11-29 Thread Deepayan Sarkar
On Monday 29 November 2004 21:07, Peter Yang wrote:
 Hi,

 Suppose I have a 4 by 4 matrix as following:

 10 6 3 1

  8 4 3 2

  6 2 4 3

  9 3 4 2

 The x axis is the column index of the matrix, the y axis is the row
 index of the matrix and the z axis is the value in the corresponding
 position of the matrix.

 I tried to use contour and image. They are not the ones I want.

You are probably looking for ?persp.

Deepayan

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


[R] New trellis settings

2004-11-29 Thread dhinds
I've just upgraded to 2.0.1 and was taken by surprise by the changes
in graphical parameter handling for lattice plots.  I'd previously
been using 1.9.1.  The old settings seem to have been replaced by a
daunting number of new options.  I've poked around a bit and have not
seen any discussion of the changes in the newsletter or on r-help but
maybe I'm overlooking something?

Specifically, I have some code that in the past changed the relative
proportions of text versus the plot area using:

  trellis.par.set('fontsize', list(text=8))

which caused all text to get smaller, and the plot area to grow to
fill the larger available space.  Now, the plot area does not grow on
its own.  I've tried fiddling with layout.heights, layout.widths, and
axis.components but there are dozens of settings available.  For many
of these settings, I have no idea what quantity I'm actually changing,
other than by trial and error.  Is there an easier way?

-- Dave

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


Re: [R] New trellis settings

2004-11-29 Thread Xin Qi
Hi, Dear all R users:
Does someone know whether R can calculate the Receiver Operating 
Characteristic (ROC) Curves? I didn't find it from the packages.

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


Re: [R] New trellis settings

2004-11-29 Thread Deepayan Sarkar
On Monday 29 November 2004 22:39, [EMAIL PROTECTED] wrote:
 I've just upgraded to 2.0.1 and was taken by surprise by the changes
 in graphical parameter handling for lattice plots.  I'd previously
 been using 1.9.1.  The old settings seem to have been replaced by a
 daunting number of new options.  

Not really. The old settings are essentially what they were, the new 
'options' are for things that used to be hard-coded in previous 
versions.

 I've poked around a bit and have not 
 seen any discussion of the changes in the newsletter or on r-help but
 maybe I'm overlooking something?
 
 Specifically, I have some code that in the past changed the relative
 proportions of text versus the plot area using:

   trellis.par.set('fontsize', list(text=8))

 which caused all text to get smaller, and the plot area to grow to
 fill the larger available space.  Now, the plot area does not grow on
 its own.  

That does seem to have been a side-effect in 1.9.1, but it was never 
intended. I would consider that behaviour a bug, not a feature.

 I've tried fiddling with layout.heights, layout.widths, and 
 axis.components but there are dozens of settings available.  For many
 of these settings, I have no idea what quantity I'm actually
 changing, other than by trial and error.  Is there an easier way?

Not really. The recommended thing to change is the settings (not the 
options) which all default to 1:

 str(trellis.par.get()$layout.heights)
List of 18
 $ top.padding  : num 1
 $ main : num 1
 $ main.key.padding : num 1
 $ key.top  : num 1
 $ key.axis.padding : num 1
 ...

I was hoping that the names would be enough of a hint. Anything with 
'padding' in the name is space, and probably the ones you want to 
change.

Deepayan

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


Re: [R] About ROC curves

2004-11-29 Thread Christoph Lehmann
package ROC from bioconductor, eg:
http://www.bioconductor.org/repository/release1.5/package/Win32/
Cheers!
Christoph
Xin Qi wrote:
Hi, Dear all R users:
Does someone know whether R can calculate the Receiver Operating 
Characteristic (ROC) Curves? I didn't find it from the packages.

Thanks a lot.
--- Xin
__
[EMAIL PROTECTED] mailing list
https://stat.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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] About ROC curves

2004-11-29 Thread BXC (Bendix Carstensen)
There is a package, Lexis, not officil though, which contains
a function ROC (and some other stuff for epidemiology). 
You can find it in:
http://biostat.ku.dk/~bxc/SPE/library/

Bendix Carstensen
--
Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2
DK-2820 Gentofte
Denmark
tel: +45 44 43 87 38
mob: +45 30 75 87 38
fax: +45 44 43 07 06
[EMAIL PROTECTED]
www.biostat.ku.dk/~bxc
--



 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Xin Qi
 Sent: Tuesday, November 30, 2004 5:49 AM
 To: [EMAIL PROTECTED]
 Subject: [R] About ROC curves
 
 
 Hi, Dear all R users:
 
 Does someone know whether R can calculate the Receiver Operating 
 Characteristic (ROC) Curves? I didn't find it from the packages.
 
 Thanks a lot.
 
 --- Xin
 
 __
 [EMAIL PROTECTED] mailing list 
 https://stat.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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html