[R] R_HOME not found

2004-07-26 Thread Rene Lindstaedt
Hi,

I have a problem with R 1.9.1. I installed it on my
mac (os 10.2.8), and then tried to start it from the
terminal. I got the following error message:

R_HOME ('/Applications/StartR.app/RAqua.app/Contents')
not found

It also won't let me start the GUI version. Any
comments or suggestions would be greatly appreciated.

Thanks,
Rene

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


Re: [R] Population simulation.

2004-07-26 Thread Anon.
[EMAIL PROTECTED] wrote:

 Hello,

 can anyone tell me if R has any special function for simulating the 
structure
 of human populations? Something like the genetic algorithm?
 I need to simulate a sample of a population with a specific 
structure. Is
 there something on R that can help me?

As others have pointed out, you need to give us some more details. 
There is an artile about simulation of ecological dynamics in last 
December's R News, which may be of some help:
http://cran.r-project.org/doc/Rnews/Rnews_2003-3.pdf

If you're simulating something like a coalescence process, then it might 
be easier to use some specialist software.  In that case, googling with 
a few relevant terms might be the way to go.

Bob
--
Bob O'Hara
Dept. of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland
Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax:  +358-9-191 51400
WWW:  http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB: http://www.jnr-eeb.org
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Read SPSS data (*.sav) in R 1.8.0 (ok) and R1.9.1(error)

2004-07-26 Thread Karl Knoblick
Hallo!

I read SPSS data in the following way:

library(Hmisc)
library(foreign)
dat-spss.get(surv_abb.sav)

In R1.9.1 I got the message:
Error in all(arg == choices) : Object typeDate not
found

In R1.8.0 the same script works fine.

Does anybody know a possibilty to read a SPSS file
under R1.9.1?

Thanks!
Karl

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


[R] computing sum of indicator variables

2004-07-26 Thread Stefan Böhringer
My problem is as follows:
i is a list of integers of variable length. Now I want to compute a new
vector/array that contains 1's at the positions indicated in i. For
example:
c(2, 4) - c(0, 1, 0, 1)

Using something like
i = i - c(0, i[2:length(i) - 1]);
sapply(i, function(x) c(rep(0, x - 1), 1)));

faces me with the problem of concatenating the result, which I could
somehow not find a solution for.

Thank you very much in advance.

Stefan

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


Re: [R] computing sum of indicator variables

2004-07-26 Thread Uwe Ligges
Stefan Böhringer wrote:
My problem is as follows:
i is a list 
Do you mean a vector?
of integers of variable length. Now I want to compute a new
vector/array 
A vector or an array (which dimensions?)?
 that contains 1's at the positions indicated in i. For
example:
c(2, 4) - c(0, 1, 0, 1)
How long should the result be? max(i)???
If you mean simple vectors in both cases, i's suggest:
  i - c(2, 4)
  x - numeric(max(i))
  x[i] - 1
Uwe Ligges

Using something like
i = i - c(0, i[2:length(i) - 1]);
sapply(i, function(x) c(rep(0, x - 1), 1)));
faces me with the problem of concatenating the result, which I could
somehow not find a solution for.
Thank you very much in advance.
Stefan
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] computing sum of indicator variables

2004-07-26 Thread Dimitris Rizopoulos
Hi Stefan,

you could try something like,

x - c(2,4,7)
as.numeric(!is.na(match(seq(1, max(x)), x)))

I hope this helps.

Best,
Dimitris


Dimitris Rizopoulos
Doctoral Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
 http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


- Original Message - 
From: Stefan Bhringer [EMAIL PROTECTED]
To: R Help [EMAIL PROTECTED]
Sent: Monday, July 26, 2004 10:45 AM
Subject: [R] computing sum of indicator variables


 My problem is as follows:
 i is a list of integers of variable length. Now I want to compute a
new
 vector/array that contains 1's at the positions indicated in i. For
 example:
 c(2, 4) - c(0, 1, 0, 1)

 Using something like
 i = i - c(0, i[2:length(i) - 1]);
 sapply(i, function(x) c(rep(0, x - 1), 1)));

 faces me with the problem of concatenating the result, which I could
 somehow not find a solution for.

 Thank you very much in advance.

 Stefan

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

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


RE: [R] computing sum of indicator variables

2004-07-26 Thread Wayne Jones
What about


x - c(2,4,7)
out-rep(0,max(x))
out[x]-1


Regards

Wayne



-Original Message-
From: Stefan Böhringer [mailto:[EMAIL PROTECTED] 
Sent: 26 July 2004 09:46
To: R Help
Subject: [R] computing sum of indicator variables

My problem is as follows:
i is a list of integers of variable length. Now I want to compute a new
vector/array that contains 1's at the positions indicated in i. For
example:
c(2, 4) - c(0, 1, 0, 1)

Using something like
i = i - c(0, i[2:length(i) - 1]);
sapply(i, function(x) c(rep(0, x - 1), 1)));

faces me with the problem of concatenating the result, which I could
somehow not find a solution for.

Thank you very much in advance.

Stefan

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


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

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


Re: [R] fisher.test FEXACT error 7

2004-07-26 Thread Ken Edwards
Thanks Sundar,
That changes the behaviour of R, but only in so far as it waits longer 
before giving the same error:

fisher.test(testDataTwoColumns, workspace = 2e8)
Error in fisher.test(testDataTwoColumns, workspace = 2e+08) :
   FEXACT error 7.
LDSTP is too small for this problem.
Try increasing the size of the workspace.
...There also seems to be an upper limit of how big the workspace can be...
 fisher.test(testDataTwoColumns, workspace = 2e9)
Error in fisher.test(testDataTwoColumns, workspace = 2e+09) :
   negative length vectors are not allowed
 fisher.test(testDataTwoColumns, workspace = 2e10)
Error in fisher.test(testDataTwoColumns, workspace = 2e+10) :
   NAs in foreign function call (arg 10)
In addition: Warning message:
NAs introduced by coercion
A further question - do you (or anyone else) think that this is a 
problem with the physical capabilities of the box that I'm running on, 
or is it likely to be an upper limit with the amount of data that the 
algorithm can handle? 

Many thanks,
Ken
Sundar Dorai-Raj wrote:

Ken Edwards wrote:
Hello,
I have an error message that doesn't seem to make sense in that 
having read the R documentation I was under the impression that R was 
able to grab as much memory as it needed, and has been able to do so 
for some time, so the advice given below about increasing the size of 
the workspace is redundant.
If I'm right, does anyone have a solution to the problem of the size 
of LDSTP?  Or is this really a message about the limit of data size 
that the function can handle?

I have tried the function using test data containing a similar number 
of (randomly generated) data points, and it worked then. There are 
258 data points in two columns (i.e. 2 * 134), if that helps.

Any advice would be very much appreciated,
Many thanks,
Ken Edwards.
R script below:
fisher.test(testData)
Error in fisher.test(testData) :
   FEXACT error 7.
LDSTP is too small for this problem.
Try increasing the size of the workspace.
Maybe you should try increasing the workspace:
fisher.test(testData, workspace = 2e6)
--sundar

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


Re: [R] Read SPSS data (*.sav) in R 1.8.0 (ok) and R1.9.1(error)

2004-07-26 Thread Jonathan Baron
On 07/26/04 10:36, Karl Knoblick wrote:
Hallo!

I read SPSS data in the following way:

library(Hmisc)
library(foreign)
dat-spss.get(surv_abb.sav)

In R1.9.1 I got the message:
Error in all(arg == choices) : Object typeDate not
found

In R1.8.0 the same script works fine.

Does anybody know a possibilty to read a SPSS file
under R1.9.1?

I cannot find spss.get in the man pages for the current version
of foreign.  It works for me with read.spss.

But I'm surprised it ever worked.  So, possibly, there is
something wrong with the spss file you are trying to import.

Jon
-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page: http://www.sas.upenn.edu/~baron
R search page: http://finzi.psych.upenn.edu/

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


Re: [R] Eclipse plugin for R or perhaps S-plus.

2004-07-26 Thread Stephan Wahlbrink
Richard Piper wrote:

 Does any one know of an eclipse (http://eclipse.org) plugin for R/S.
 
 thanks
 
 RIchard

Hi,

You can download a small Eclipse plug-in for R from my homepage:
http://www.walware.de/rplugin.zip . 

Simply unzip the file into the Eclipse directory. The plug-in requires
version 3.0 of Eclipse, it is not compatible with version 2.x. 

The plug-in provides syntax highlighting for R files and R documentations
(Rd files). Furthermore, editor functions concerning matching brackets
(highlighting, goto, select enclosing content on double click) are
implemented. Naturally, you can use the language independent IDE features
of Eclipse such as Local History, QuickDiff, CVS, ... 
You can configure the editors in the Eclipse preference dialog under
StatET.

Best regards,
Stephan Wahlbrink

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


[R] Econometrics Packages On R

2004-07-26 Thread Vito Ricci
Dear Allan,
I still use R principally in ts analysis. Tha main
packages I employ are: ts, tseries, ast (it supplies
some helpfull functions and can be downloaded from
CRAN) and lmtest. Just in this period I preparing a
summary of functions involved in ts analysis grouped
by  goal. I would send this short document to CRAN in
next weeks when I end it. If you wish I'll send you a
copy.

Other functions can be found in:

Rmetrics which is a collection of functions which may
be useful for teaching Financial Engineering and
Computational Finance.

See:

http://www.itp.phys.ethz.ch/econophysics/R/

Cordially

Vito


Hello,

I have just started using R, maybe more like learning
it. I am 
interested in using it for Time Series Analysis and I
wanted to know if 
anyone was familiar with packages other than TS that
might be appropriate.

Allan

=
Diventare costruttori di soluzioni

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

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


[R] X11 device problem on linux: 100% cpu usage

2004-07-26 Thread David Whiting
Hi,

I'm using R 1.9.1 (patched, 5th July) on linux
(Mandrake 9.2) and am having a problem with the X11()
device. Trying to plot(1:10) results in my CPU going
to 100% and I have to terminate the process. Using
postscript() with the same plot is fine. Everything
else on my system seems to work fine. I have googled
the R site for X11 and (problem OR error OR cpu) and
have not seen anything that is recent or looks
relevent, so I think this is a problem I have created
myself.

I'm not sure where to start with identifying the
cause. Can someone suggest some things that I should
look at?  

Thanks.

Dave.

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


[R] covariate selection in cox model (counting process)

2004-07-26 Thread Mayeul KAUFFMANN
Hello everyone,
I am searching for a covariate selection procedure in a cox model
formulated
as a counting process.
I use intervals, my formula looks like coxph(Surv(start,stop,status)~
x1+x2+...+cluster(id),robust=T) where id is a country code (I study
occurence of civil wars from 1962 to 1997).
I'd like something not based on p-values, since they have several flaws
for
this purpose.
I turned to other criteria but all the articles I read seems to apply to
the
classical formulation of the cox model, not the counting process one (or
they apply to both but I am not aware of this)

I've tried AIC with
 step(cox.fit)
or
 stepAIC(cox.fit)

and BIC using
step(cox.fit,k = log(n))
but there seems to be 2 theoretical problems to address:

(1) These values are based on partial loglikelihood (loglik)
I wonder if this is correct with the cox model formulated as a *counting
process*, with many (consecutive) observations for a given

individual, and then some observation not being independent

Since the likelihood ratio and score tests assume independence of
observations within a cluster, the Wald and robust score tests

do not (R warning), and the likelihood ratio being based on loglik, can
I
use loglik in BIC with some dependent observations?

[I have 170 individuals (namely, countries) for 36 year, some single
countries having up to 140 very short observation intervals, other
having
(on

the other extreme) only 1 long interval per year. That's because I
created
artificial covariates measuring the proximity since some

events: exp(-days.since.event/a.chosen.parameter). I splitted every
yearly
interval for which these covariates change rapidly (i.e.

when the events are recent) yielding up to 11 intervals a year]

(2) What penalized term to used?

It seems natural to include the number of covariates, k.
What about the number of observations?

I found several definitions:
AIC= -2 loglik(b) +  2.k
Schwartz Bayesian information criteria:
SBIC= -2 loglik(b) +  k ln(n)

Frédérique Letué (author of PhD thesis COX MODEL: ESTIMATION VIA MODEL
SELECTION AND BIVARIATE SHOCK MODEL,
http://www-lmc.imag.fr/lmc-sms/Frederique.Letue/These3.ps)
suggested me
AIC= - loglik(b) +  2.k/n
BIC= - loglik(b) +  2.ln(n).k/n, with other possible values for
parameter
2 in this case (see her thesis p.100, but this section is in French)

All these do not tell *what to take for n*. There are 3 main
possibilities:

a) Taking the number of observations (including censored one) will give
a
huge n (around 6000 to 8000), which may seem meaningless

since some observations are only a few days long.
With n at the denominator (Letué's criteria), the penalized term would
be so
low that it's like not having it:
log(7000)/7000
[1] 0.001264809

(where loglik from summary(cox.fit) range from -155 to -175, dependig on
the
model)

b) Volinsky  Raftery propose a revision of the penalty term in BIC so
that
the penalty is defined in terms of the number of

uncensored events instead of the number of observations. (Volinsky 
Raftery , Bayesian Information Criterion for Censored

Survival Models, June 16, 1999,
http://www.research.att.com/~volinsky/papers/biocs.ps)

This could be computed with
sum(coxph.detail(cox.interac.dsi6mois)$nevent)

Letué's BIC penalized trerm with 50 events will then be
 2*log(50)/50
[1] 0.1564809
which will have more effects.

However, adding or removing a country which has data for the 36 years
but no
event (then, it is censored) will not change this BIC.

Thus, it is not suitable to account for missing data that do not reduce
the
number of event.
I'd like the criteria to take this into account, because all covariates
do
not have the same missing data.
The question is: When I have the choice with adding a covariate, x10 or
x11,
which have different (not nested) set of missing

values, which one is best?
Estimating all subsets of the full model (full model = all covariates)
with
a dataset containing no missing data for the full model

would be a solution but would more than halve the dataset for many
subsets
of the covariates.

I should mention that step(cox.fit) gives a warning and stops:
Error in step(cox.fit) : number of rows in use has changed: remove
missing
values?

which makes me ask whether the whole procedure is OK with model of
different
sample size.


c) For discrete time event history analysis, the same choice has been
made,
while the total number of exposure time units has also

been used, for consistency with logistic regresion
(Raftery,Lewis,Aghajanian
and Kahn,1993;Raftery Lewisand Aghajanian,1994)

(Raftery, Bayesian Model Selection in Social Research, 1994,
http://www.stat.washington.edu/tech.reports/bic.ps)

I am not sure what exposure time units mean. But since I could have
used a
logit model with yearly observations [but with many

flaws...], I suggest I could use the number of years (sum of length of
intervals, in year)

 sum((fit$y)[,2]-(fit$y)[,1])/365.25
[1] 3759.537

This may still be too high.

Since I have datas 

Re: [R] X11 device problem on linux: 100% cpu usage

2004-07-26 Thread Barry Rowlingson
David Whiting wrote:
I'm using R 1.9.1 (patched, 5th July) on linux
(Mandrake 9.2) and am having a problem with the X11()
device. Trying to plot(1:10) results in my CPU going
to 100% 

I'm not sure where to start with identifying the
cause. Can someone suggest some things that I should
look at?  
 First off, you can try and figure out if its the client (R) or the 
server (your X-windows display server).

 Can you connect to your problem machine from another host (preferably 
one with a different Linux distro, or different X server) and run R, 
sending the graphics over the network. Does it still cause your problem 
machine to go slow? Then its something on the client side.

 If that works fine, then its something to do with the X server on the 
problem machine. Or an interaction term between client and server!

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


Re: [R] interpreting profiling output

2004-07-26 Thread Luke Tierney
On Sun, 25 Jul 2004, Peter Dalgaard wrote:

 Kasper Daniel Hansen [EMAIL PROTECTED] writes:
 
  I have some trouble interpreting the output from profiling. I have
  read the help pages Rprof, summaryRprof and consult the R extensions
  manual, but I still have problems understanding the output.
  
  Basically the output consist of self.time and total.time. I have the
  understanding that total.time is the time spent in a given function
  including any subcalls or child functions or whatever the technical
  term for that activity is. In contrasts self.time is the time spent in
  the function excluding subcalls.
  
  Now, in my understanding basically everything in R is functions. I
  would then guess that for almost any function (except the atomic
  ones) the self.time would be very small as it would spend most of its
  time calling other functions (again, since almost everything is a
  function). So how do R determine when a subfunction is called?
 ...brutal snippage...
  I guess some of the answers would be clear if I had a firm grasp of
  the inner workings of R :)
 
 In a word, yes... 
 
 The profiling keeps track of R's *context stack* which is not quite
 the same as function calls. Essentially, it only counts R functions that
 are actually written in R, but not .Internal, .Primitive, etc. So
 self counts the amount of time that a function was at the top of the
 stack. This is done by a periodic poll which dumps out the context
 stack at regular intervals. Seeing cases where the self percentages
 don't add to 100% is, I believe, simply due to truncation of the tails
 -- that is, there is a large number of different functions which each
 are counted a few times, and these are not shown in the summary output.
 
 [Sorry about the late reply, but I was out of town, and noone seems to
 have answered this.]

Just one additional clarification: There are two flavors of
.Primitive, 'builtin' and 'special'.  You can tell which is which
using typeof().  Builtins are things like arithmetic operations and
specials include control constructs like `for`.  At present profiling
does record builtins but not specials.  Recording specials is
something we would like to do eventually but it requires more changes
to the call stack (and dealing with more interections with those
changes) so it hasn't happened yet. .Internal is a special, so no
.Internal calls are recorded.

luke

-- 
Luke Tierney
University of Iowa  Phone: 319-335-3386
Department of Statistics andFax:   319-335-3017
   Actuarial Science
241 Schaeffer Hall  email:  [EMAIL PROTECTED]
Iowa City, IA 52242 WWW:  http://www.stat.uiowa.edu

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


[R] Re: smooth non cumulative baseline hazard in Cox model

2004-07-26 Thread Mayeul KAUFFMANN
Hello everyone,
I am searching for a covariate selection procedure in a cox model formulated
as a counting process.
I use intervals, my formula looks like coxph(Surv(start,stop,status)~
x1+x2+...+cluster(id),robust=T) where id is a country code (I study
occurence of civil wars from 1962 to 1997).
I'd like something not based on p-values, since they have several flaws for
this purpose.
I turned to other criteria but all the articles I read seems to apply to the
classical formulation of the cox model, not the counting process one (or
they apply to both but I am not aware of this)

I've tried AIC with
 step(cox.fit)
or
 stepAIC(cox.fit)

and BIC using
step(cox.fit,k = log(n))
but there seems to be 2 theoretical problems to address:

(1) These values are based on partial loglikelihood (loglik)
I wonder if this is correct with the cox model formulated as a *counting
process*, with many (consecutive) observations for a given

individual, and then some observation not being independent

Since the likelihood ratio and score tests assume independence of
observations within a cluster, the Wald and robust score tests

do not (R warning), and the likelihood ratio being based on loglik, can I
use loglik in BIC with some dependent observations?

[I have 170 individuals (namely, countries) for 36 year, some single
countries having up to 140 very short observation intervals, other having
(on

the other extreme) only 1 long interval per year. That's because I created
artificial covariates measuring the proximity since some

events: exp(-days.since.event/a.chosen.parameter). I splitted every yearly
interval for which these covariates change rapidly (i.e.

when the events are recent) yielding up to 11 intervals a year]

(2) What penalized term to used?

It seems natural to include the number of covariates, k.
What about the number of observations?

I found several definitions:
AIC= -2 loglik(b) +  2.k
Schwartz Bayesian information criteria:
SBIC= -2 loglik(b) +  k ln(n)

Frédérique Letué (author of PhD thesis COX MODEL: ESTIMATION VIA MODEL
SELECTION AND BIVARIATE SHOCK MODEL,
http://www-lmc.imag.fr/lmc-sms/Frederique.Letue/These3.ps)
suggested me
AIC= - loglik(b) +  2.k/n
BIC= - loglik(b) +  2.ln(n).k/n, with other possible values for parameter
2 in this case (see her thesis p.100, but this section is in French)

All these do not tell *what to take for n*. There are 3 main possibilities:

a) Taking the number of observations (including censored one) will give a
huge n (around 6000 to 8000), which may seem meaningless

since some observations are only a few days long.
With n at the denominator (Letué's criteria), the penalized term would be so
low that it's like not having it:
log(7000)/7000
[1] 0.001264809

(where loglik from summary(cox.fit) range from -155 to -175, dependig on the
model)

b) Volinsky  Raftery propose a revision of the penalty term in BIC so that
the penalty is defined in terms of the number of

uncensored events instead of the number of observations. (Volinsky 
Raftery , Bayesian Information Criterion for Censored

Survival Models, June 16, 1999,
http://www.research.att.com/~volinsky/papers/biocs.ps)

This could be computed with
sum(coxph.detail(cox.interac.dsi6mois)$nevent)

Letué's BIC penalized trerm with 50 events will then be
 2*log(50)/50
[1] 0.1564809
which will have more effects.

However, adding or removing a country which has data for the 36 years but no
event (then, it is censored) will not change this BIC.

Thus, it is not suitable to account for missing data that do not reduce the
number of event.
I'd like the criteria to take this into account, because all covariates do
not have the same missing data.
The question is: When I have the choice with adding a covariate, x10 or x11,
which have different (not nested) set of missing

values, which one is best?
Estimating all subsets of the full model (full model = all covariates) with
a dataset containing no missing data for the full model

would be a solution but would more than halve the dataset for many subsets
of the covariates.

I should mention that step(cox.fit) gives a warning and stops:
Error in step(cox.fit) : number of rows in use has changed: remove missing
values?

which makes me ask whether the whole procedure is OK with model of different
sample size.


c) For discrete time event history analysis, the same choice has been made,
while the total number of exposure time units has also

been used, for consistency with logistic regresion (Raftery,Lewis,Aghajanian
and Kahn,1993;Raftery Lewisand Aghajanian,1994)

(Raftery, Bayesian Model Selection in Social Research, 1994,
http://www.stat.washington.edu/tech.reports/bic.ps)

I am not sure what exposure time units mean. But since I could have used a
logit model with yearly observations [but with many

flaws...], I suggest I could use the number of years (sum of length of
intervals, in year)

 sum((fit$y)[,2]-(fit$y)[,1])/365.25
[1] 3759.537

This may still be too high.

Since I have datas 

[R] aggregate function

2004-07-26 Thread Luis Rideau Cruz
Hi all,
I have the folowing frame(there are more columns than shown),
   1  2   34   5 
Year Total  TusWhi  Norw
1994 1.00  1830   0  355 
1995 1.00 0   00 
1995 1.00 0   00 
1995 1.00  49104280  695 
1997 1.00 0   0  110 
1997 0.58 0   00 
1997 1.00 0   00 
1994 1.00 0   00 
1997 1.00 0  40   70 
1998 1.00 0   0 1252 
1999 1.04 0  740 
1999 1.00 0   00 
1999 1.02 0   00 
1999 1.00 0   00 
1999 1.00 0   0  171 
1999 1.00  1794   0  229 
1999 1.00 035250 
1997 1.00  13351185  147 
1997 1.00  49251057 4801 
1997 1.00 06275 1773 

I try to get sum(Total) by Year in which Tus0,  sum(Total) by Year in which 
Whi0,,,and so on.

I have done something like this;

a-as.list(numeric(3))
for (i in 3:5)
{
a[[i]]-aggregate(frame[,Total],list(Year=frame$Year,
   Tus=frame$i0),sum)
}

But I get

 Error in FUN(X[[as.integer(1)]], ...) : arguments must have same length

Also by doing one by one

aggregate(frame[,Total],list(Year=frame$Year,
   Tus=frame$Tus0),sum)


The result is something like;

   Year  Tus x
 1994 FALSE 49.69
 1995 FALSE 49.35
 1996 FALSE 56.95
 1997 FALSE 57.00
 1998 FALSE 57.00
 1999 FALSE 58.09
 2000 FALSE 56.97
 2001 FALSE 57.95
 2002 FALSE 57.10
 2003 FALSE 56.16
 2000  TRUE  1.00
 2002  TRUE  1.00
 2003  TRUE  2.01


Help


Thank you

Luis Ridao Cruz
Fiskirannsóknarstovan
Nóatún 1
P.O. Box 3051
FR-110 Tórshavn
Faroe Islands
Phone: +298 353900
Phone(direct): +298 353912
Mobile: +298 580800
Fax: +298 353901
E-mail:  [EMAIL PROTECTED]
Web:www.frs.fo

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


Re: [R] R on AMD64 (Opteron)

2004-07-26 Thread Prof Brian Ripley
We are using Fedora Core 2 and some version(s) of SuSe Linux on various
dual Opteron servers.  We also have a copy of RHEL, but AFAIK are not
currently using it.  I've been using a dual Opteron 248 under FC2

I don't know that Windows XP 64-Bit Edition is actually released yet 
(although there have beem public betas).  However, as Peter D says, one 
would need a suitable compiler, binutils etc and the MinGW project is 
unlikely to provide them any time soon (if ever, although the project's 
FAQ suggests that it does intend to).

On Sat, 24 Jul 2004, Jose Quesada wrote:

 Also, I'm curious...
 Not that this would be my first choice for a server, but...
 Anyone running Windows XP 64-Bit Edition? Any success compiling R?
 
 
 
 On Sat, 24 Jul 2004 18:07:18 +1000, Andrew Robinson [EMAIL PROTECTED] wrote:
  Professor Ripley,
 
  which operating system are you using for these servers, please?
  Thanks,
 
  Andrew
 
 
 
  - Original Message -
  From: Prof Brian Ripley [EMAIL PROTECTED]
  Date: Saturday, July 24, 2004 5:41 pm
  Subject: Re: [R] R on AMD64 (Opteron)
 
   On Fri, 23 Jul 2004, Asselin Jerome wrote:
  
Hi,
   
I was wondering if anyone has had good experiences using R on
   Linux with
dual AMD64 (Opteron) processors. I'm thinking of buying a couple
   of such
servers, but I'd like to make sure R would work fine.
   
The R Installation and Administration guide notes that there
   may be
some problems with BLAS libraries. That's all I could find about
   R on
AMD64.
  
   Actually it says with ATLAS BLAS, not generically.
  
Please share your experience using R on AMD64.
  
   Quite a few people, including us, are using R on such servers
   routinelywith no problems at all.  There are still some issues
   about how to squeeze
   the maximum performance out of them (e.g. which BLAS to use -- we
   are
   using Goto's -- and which compiler to use, e.g. Portland Group or
   Intel).
   --
   Brian D. Ripley,  [EMAIL PROTECTED]
   Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
   University of Oxford, Tel:  +44 1865 272861 (self)
   1 South Parks Road, +44 1865 272866 (PA)
   Oxford OX1 3TG, UKFax:  +44 1865 272595

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

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


Re: [R] aggregate function

2004-07-26 Thread TEMPL Matthias
Hi,

# x ... your frame
attach(x)
sum(Total[Year==1997  Tus  0])

I hope this helps

Best,
Matthias


 -Ursprüngliche Nachricht-
 Von: Luis Rideau Cruz [mailto:[EMAIL PROTECTED] 
 Gesendet: Montag, 26. Juli 2004 14:52
 An: [EMAIL PROTECTED]
 Betreff: [R] aggregate function
 
 
 Hi all,
 I have the folowing frame(there are more columns than shown),
1  2   34   5 
 Year Total  TusWhi  Norw
 1994 1.00  1830   0  355 
 1995 1.00 0   00 
 1995 1.00 0   00 
 1995 1.00  49104280  695 
 1997 1.00 0   0  110 
 1997 0.58 0   00 
 1997 1.00 0   00 
 1994 1.00 0   00 
 1997 1.00 0  40   70 
 1998 1.00 0   0 1252 
 1999 1.04 0  740 
 1999 1.00 0   00 
 1999 1.02 0   00 
 1999 1.00 0   00 
 1999 1.00 0   0  171 
 1999 1.00  1794   0  229 
 1999 1.00 035250 
 1997 1.00  13351185  147 
 1997 1.00  49251057 4801 
 1997 1.00 06275 1773 
 
 I try to get sum(Total) by Year in which Tus0,  
 sum(Total) by Year in which Whi0,,,and so on.
 
 I have done something like this;
 
 a-as.list(numeric(3))
 for (i in 3:5)
 {
 a[[i]]-aggregate(frame[,Total],list(Year=frame$Year,

 Tus=frame$i0),sum) }
 
 But I get
 
  Error in FUN(X[[as.integer(1)]], ...) : arguments must have 
 same length
 
 Also by doing one by one
 
 aggregate(frame[,Total],list(Year=frame$Year,

 Tus=frame$Tus0),sum)
 
 
 The result is something like;
 
Year  Tus x
  1994 FALSE 49.69
  1995 FALSE 49.35
  1996 FALSE 56.95
  1997 FALSE 57.00
  1998 FALSE 57.00
  1999 FALSE 58.09
  2000 FALSE 56.97
  2001 FALSE 57.95
  2002 FALSE 57.10
  2003 FALSE 56.16
  2000  TRUE  1.00
  2002  TRUE  1.00
  2003  TRUE  2.01
 
 
 Help
 
 
 Thank you
 
 Luis Ridao Cruz
 Fiskirannsóknarstovan
 Nóatún 1
 P.O. Box 3051
 FR-110 Tórshavn
 Faroe Islands
 Phone: +298 353900
 Phone(direct): +298 353912
 Mobile: +298 580800
 Fax: +298 353901
 E-mail:  [EMAIL PROTECTED]
 Web:www.frs.fo
 
 __
 [EMAIL PROTECTED] mailing list 
 https://www.stat.math.ethz.ch/mailman/listinfo /r-help
 PLEASE 
 do read the posting guide! 
 http://www.R-project.org/posting-guide.html


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


Re: [R] aggregate function

2004-07-26 Thread TEMPL Matthias
Hi,
 
# x ... your frame
attach(x)
sum(Total[Year==1997  Tus  0])
 
I hope this helps
 
Best,
Matthias Templ
 
 
  -Ursprüngliche Nachricht-
  Von: Luis Rideau Cruz [mailto:[EMAIL PROTECTED]
  Gesendet: Montag, 26. Juli 2004 14:52
  An: [EMAIL PROTECTED]
  Betreff: [R] aggregate function
  
  
  Hi all,
  I have the folowing frame(there are more columns than shown),
 1  2   34   5 
  Year Total  TusWhi  Norw
  1994 1.00  1830   0  355 
  1995 1.00 0   00 
  1995 1.00 0   00 
  1995 1.00  49104280  695 
  1997 1.00 0   0  110 
  1997 0.58 0   00 
  1997 1.00 0   00 
  1994 1.00 0   00 
  1997 1.00 0  40   70 
  1998 1.00 0   0 1252 
  1999 1.04 0  740 
  1999 1.00 0   00 
  1999 1.02 0   00 
  1999 1.00 0   00 
  1999 1.00 0   0  171 
  1999 1.00  1794   0  229 
  1999 1.00 035250 
  1997 1.00  13351185  147 
  1997 1.00  49251057 4801 
  1997 1.00 06275 1773 
  
  I try to get sum(Total) by Year in which Tus0,
  sum(Total) by Year in which Whi0,,,and so on.
  
  I have done something like this;
  
  a-as.list(numeric(3))
  for (i in 3:5)
  {
  a[[i]]-aggregate(frame[,Total],list(Year=frame$Year,
 
  Tus=frame$i0),sum) }
  
  But I get
  
   Error in FUN(X[[as.integer(1)]], ...) : arguments must have
  same length
  
  Also by doing one by one
  
  aggregate(frame[,Total],list(Year=frame$Year,
 
  Tus=frame$Tus0),sum)
  
  
  The result is something like;
  
 Year  Tus x
   1994 FALSE 49.69
   1995 FALSE 49.35
   1996 FALSE 56.95
   1997 FALSE 57.00
   1998 FALSE 57.00
   1999 FALSE 58.09
   2000 FALSE 56.97
   2001 FALSE 57.95
   2002 FALSE 57.10
   2003 FALSE 56.16
   2000  TRUE  1.00
   2002  TRUE  1.00
   2003  TRUE  2.01
  
  
  Help
  
  
  Thank you
  
  Luis Ridao Cruz
  Fiskirannsóknarstovan
  Nóatún 1
  P.O. Box 3051
  FR-110 Tórshavn
  Faroe Islands
  Phone: +298 353900
  Phone(direct): +298 353912
  Mobile: +298 580800
  Fax: +298 353901
  E-mail:  [EMAIL PROTECTED]
  Web:www.frs.fo
  
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo /r-help
  PLEASE 
  do read the posting guide! 
  http://www.R-project.org/posting-guide.html
  


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


RE: [R] aggregate function

2004-07-26 Thread Liaw, Andy
I would try something like:

 lapply(frame[3:5], function(i) tapply(frame$Total[i0], frame$Year[i0],
sum))
$Tus
1994 1995 1997 1999 
   1121 

$Whi
1995 1997 1999 
1.00 4.00 2.04 

$Norw
1994 1995 1997 1998 1999 
   11512 

HTH,
Andy

  
 From: Luis Rideau Cruz
 
 Hi all,
 I have the folowing frame(there are more columns than shown),
1  2   34   5 
 Year Total  TusWhi  Norw
 1994 1.00  1830   0  355 
 1995 1.00 0   00 
 1995 1.00 0   00 
 1995 1.00  49104280  695 
 1997 1.00 0   0  110 
 1997 0.58 0   00 
 1997 1.00 0   00 
 1994 1.00 0   00 
 1997 1.00 0  40   70 
 1998 1.00 0   0 1252 
 1999 1.04 0  740 
 1999 1.00 0   00 
 1999 1.02 0   00 
 1999 1.00 0   00 
 1999 1.00 0   0  171 
 1999 1.00  1794   0  229 
 1999 1.00 035250 
 1997 1.00  13351185  147 
 1997 1.00  49251057 4801 
 1997 1.00 06275 1773 
 
 I try to get sum(Total) by Year in which Tus0,  
 sum(Total) by Year in which Whi0,,,and so on.
 
 I have done something like this;
 
 a-as.list(numeric(3))
 for (i in 3:5)
 {
 a[[i]]-aggregate(frame[,Total],list(Year=frame$Year,

 Tus=frame$i0),sum)
 }
 
 But I get
 
  Error in FUN(X[[as.integer(1)]], ...) : arguments must have 
 same length
 
 Also by doing one by one
 
 aggregate(frame[,Total],list(Year=frame$Year,

 Tus=frame$Tus0),sum)
 
 
 The result is something like;
 
Year  Tus x
  1994 FALSE 49.69
  1995 FALSE 49.35
  1996 FALSE 56.95
  1997 FALSE 57.00
  1998 FALSE 57.00
  1999 FALSE 58.09
  2000 FALSE 56.97
  2001 FALSE 57.95
  2002 FALSE 57.10
  2003 FALSE 56.16
  2000  TRUE  1.00
  2002  TRUE  1.00
  2003  TRUE  2.01
 
 
 Help
 
 
 Thank you
 
 Luis Ridao Cruz
 Fiskirannsóknarstovan
 Nóatún 1
 P.O. Box 3051
 FR-110 Tórshavn
 Faroe Islands
 Phone: +298 353900
 Phone(direct): +298 353912
 Mobile: +298 580800
 Fax: +298 353901
 E-mail:  [EMAIL PROTECTED]
 Web:www.frs.fo
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


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


RE: [R] R on AMD64 (Opteron)

2004-07-26 Thread Liaw, Andy
Just one more thing for folks intending to try Opterons with 1 cpu:  You'll
probably want to use a NUMA kernel, rather than a SMP one.

Cheers,
Andy

 From: Prof Brian Ripley
 
 We are using Fedora Core 2 and some version(s) of SuSe Linux 
 on various
 dual Opteron servers.  We also have a copy of RHEL, but AFAIK are not
 currently using it.  I've been using a dual Opteron 248 under FC2
 
 I don't know that Windows XP 64-Bit Edition is actually released yet 
 (although there have beem public betas).  However, as Peter D 
 says, one 
 would need a suitable compiler, binutils etc and the MinGW project is 
 unlikely to provide them any time soon (if ever, although the 
 project's 
 FAQ suggests that it does intend to).
 
 On Sat, 24 Jul 2004, Jose Quesada wrote:
 
  Also, I'm curious...
  Not that this would be my first choice for a server, but...
  Anyone running Windows XP 64-Bit Edition? Any success compiling R?
  
  
  
  On Sat, 24 Jul 2004 18:07:18 +1000, Andrew Robinson 
 [EMAIL PROTECTED] wrote:
   Professor Ripley,
  
   which operating system are you using for these servers, please?
   Thanks,
  
   Andrew
  
  
  
   - Original Message -
   From: Prof Brian Ripley [EMAIL PROTECTED]
   Date: Saturday, July 24, 2004 5:41 pm
   Subject: Re: [R] R on AMD64 (Opteron)
  
On Fri, 23 Jul 2004, Asselin Jerome wrote:
   
 Hi,

 I was wondering if anyone has had good experiences using R on
Linux with
 dual AMD64 (Opteron) processors. I'm thinking of 
 buying a couple
of such
 servers, but I'd like to make sure R would work fine.

 The R Installation and Administration guide notes that there
may be
 some problems with BLAS libraries. That's all I could 
 find about
R on
 AMD64.
   
Actually it says with ATLAS BLAS, not generically.
   
 Please share your experience using R on AMD64.
   
Quite a few people, including us, are using R on such servers
routinelywith no problems at all.  There are still some issues
about how to squeeze
the maximum performance out of them (e.g. which BLAS to 
 use -- we
are
using Goto's -- and which compiler to use, e.g. 
 Portland Group or
Intel).
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  
 http://www.stats.ox.ac.uk/~ripley/
University of 
 Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
 
 -- 
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


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


Re: [R] R on AMD64 (Opteron)

2004-07-26 Thread Jerome Asselin
- Original Message - 
From: Liaw, Andy [EMAIL PROTECTED]
To: 'Prof Brian Ripley' [EMAIL PROTECTED]; Jose Quesada
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, July 26, 2004 9:18 AM
Subject: RE: [R] R on AMD64 (Opteron)


 Just one more thing for folks intending to try Opterons with 1 cpu:
You'll
 probably want to use a NUMA kernel, rather than a SMP one.

 Cheers,
 Andy

Thanks for the advice, but is there another reason why you write this beside
a large (I mean 8) number of CPUs?

At http://lse.sourceforge.net/numa/faq/ I read,

What is the difference between NUMA and SMP?
The NUMA architecture was designed to surpass the scalability limits of the
SMP architecture. With SMP, which stands for Symmetric Multi-Processing, all
memory access are posted to the same shared memory bus. This works fine for
a relatively small number of CPUs, but the problem with the shared bus
appears when you have dozens, even hundreds, of CPUs competing for access to
the shared memory bus. NUMA alleviates these bottlenecks by limiting the
number of CPUs on any one memory bus, and connecting the various nodes by
means of a high speed interconnect.

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


Re: [R] covariate selection in cox model (counting process)

2004-07-26 Thread Thomas Lumley
On Mon, 26 Jul 2004, Mayeul KAUFFMANN wrote:

 Hello everyone,
 I am searching for a covariate selection procedure in a cox model
 formulated
 as a counting process.
 I use intervals, my formula looks like coxph(Surv(start,stop,status)~
 x1+x2+...+cluster(id),robust=T) where id is a country code (I study
 occurence of civil wars from 1962 to 1997).
 I'd like something not based on p-values, since they have several flaws
 for
 this purpose.

You may be out of luck.  In the case of recurrent events coxph() is not
using maximum likelihood or even maximum partial likelihood. It is
maximising the quantity that (roughly speaking) would be the partial
likelihood if the covariates explained all the cluster differences.

Partial likelihood for single events does have an AIC analogue that works
reasonably well (not surprisingly, since the partial likelihood is also a
perfectly valid marginal likelihood for the ranks of the survival times).
For recurrent events this isn't going to work.

If you absolutely have to do covariate selection you may need to look for
a maximum likelihood approach, such as a parametric model with random
effects to describe the dependence.  You might be able to use survreg()
with frailty() terms.

-thomas

Thomas Lumley   Assoc. Professor, Biostatistics
[EMAIL PROTECTED]   University of Washington, Seattle

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


Re: [R] Read SPSS data (*.sav) in R 1.8.0 (ok) and R1.9.1(error)

2004-07-26 Thread Thomas Lumley
On Mon, 26 Jul 2004, [iso-8859-1] Karl Knoblick wrote:

 Hallo!

 I read SPSS data in the following way:

 library(Hmisc)
 library(foreign)
 dat-spss.get(surv_abb.sav)

 In R1.9.1 I got the message:
 Error in all(arg == choices) : Object typeDate not
 found

 In R1.8.0 the same script works fine.

 Does anybody know a possibilty to read a SPSS file
 under R1.9.1?


YOu should just be able to use read.spss in the foreign package.

-thomas

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


[R] binning a vector

2004-07-26 Thread Arne.Muller
Hello,

I was wondering wether there's a function in R that takes two vectors (of same length) 
as input and computes mean values for bins (intervals) or even a sliding window over 
these vectros.

I've several x/y data set (input/response) that I'd like plot together. Say the x-data 
for one data set goes from -5 to 14 with 12,000 values, then I'd like to bin the 
x-vector in steps of +1 and calculate and plot the mean of the x-values and the 
y-values within each bin.

I was browsing the R-docs but couldn't find anything appropiate.

thanks for hints + kind regads,

Arne

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


[R] choosing constraints for function optim method=L-BFGS-B when they are in terms of other parameter values

2004-07-26 Thread Tom Stone
I have a function of several variables which I wish to minimise over four
variables, two of the upper bounds for which are defined in terms of other
variables in the model over which minimisation will take place. I cannot
work out how to code this in such a way as to avoid getting an error message
when I run the code.

If anyone can provide any assistance I will be most grateful.

Best Regards

Tom Stone

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


Re: [R] help(package)-sink()

2004-07-26 Thread Prof Brian Ripley
On Sun, 25 Jul 2004, Thomas Lumley wrote:

 On Sat, 24 Jul 2004, Spencer Graves wrote:
 
 
4.  A request for packageInfo.print returned object ... not
  found.
 
 I think someone may have been contaminated by Java or some such. It should
 be print.packageInfo
 
   A request for class(mclustInfo) confirmed that it was a
  packageInfo object, so I tried getMethod(print,  packageInfo);   I
  got, 'No generic function defined for print'.  Then I tried,
  getMethod(show, packageInfo);  I got, 'No method defined for
  function show and signature object = packageInfo'.
 
 
 For S3 methods you need getS3method(print,packageInfo) rather than
 getMethod.
 
 People often recommend getAnywhere(print.packageInfo), which does take
 less typing, but I prefer getS3method.

They are not exactly equivalent, though.  Although I know of no actual
examples, it is possible to register something like printPackageInfo() as
the S3 method for print() for class packageInfo.  Then getS3method will
work and getAnywhere will not.

The advantage of getAnywhere is that it is blunderbuss designed to pick up 
all possible matches for any sort of R object, which can be useful.

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

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


[R] installing problems repeated.tgz linux

2004-07-26 Thread Christian Schulz
Hi,

i try several possibilities adn looking in the archive,
 but didn't getting success to install  j.lindsey's  usefuel library 
repeated on my linux (suse9.0 with kernel 2.6.7,R.1.9.1)

P.S. Windows, works  fine

Many thanks for help
Christian


[EMAIL PROTECTED]:/space/downs R CMD INSTALL - l /usr/lib/R/library   repeated
WARNING: invalid package '-'
WARNING: invalid package 'l'
WARNING: invalid package '/usr/lib/R/library'
* Installing *source* package 'repeated' ...
** libs
/usr/lib/R/share/make/shlib.mk:5: *** Target-Muster enthält kein »%«.  
Schluss.
ERROR: compilation failed for package 'repeated'
** Removing '/usr/lib/R/library/repeated'

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


Re: [R] binning a vector

2004-07-26 Thread Deepayan Sarkar
On Monday 26 July 2004 10:11, [EMAIL PROTECTED] wrote:
 Hello,

 I was wondering wether there's a function in R that takes two vectors
 (of same length) as input and computes mean values for bins
 (intervals) or even a sliding window over these vectros.

 I've several x/y data set (input/response) that I'd like plot
 together. Say the x-data for one data set goes from -5 to 14 with
 12,000 values, then I'd like to bin the x-vector in steps of +1 and
 calculate and plot the mean of the x-values and the y-values within
 each bin.

 I was browsing the R-docs but couldn't find anything appropiate.

Do you know about loess? It's not exactly what you describe, but maybe 
it's what you really want.

Deepayan

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


[R] zsh and R

2004-07-26 Thread A.J. Rossini

In the process of evaluating new shells, I've run into a few problems
with zsh and the R CMD build, R CMD check scripts.  

I'd like to ask a few questions off-line if anyone has experience with
R and the zsh completion/substitution functionality.

Note that bash continues to work as well as ever, just that zsh is
being finicky.

best,
-tony

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

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

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


RE: [R] installing problems repeated.tgz linux

2004-07-26 Thread Liaw, Andy
 From: Christian Schulz
 
 Hi,
 
 i try several possibilities adn looking in the archive,
  but didn't getting success to install  j.lindsey's  usefuel library 
 repeated on my linux (suse9.0 with kernel 2.6.7,R.1.9.1)
 
 P.S. Windows, works  fine
 
 Many thanks for help
 Christian
 
 
  R CMD INSTALL - l /usr/lib/R/library   repeated
   ^
Try again without that space.

Andy

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


[R] factanal - rotation = oblimin

2004-07-26 Thread Antonio Prioglio
Hi list.

To the best of mylimited understandig currently R (unlike S)  does not
support oblimin criterion for exploratory factor analysis.

Searching through the contributed packages I did not notice any additional 
package for factor analysis.

Does anybody know if such function is present within any package?

Saluti,
Antonio Prioglio

-- 
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
Aristoteles


/\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL 
 X   - AGAINST MS ATTACHMENTS
/ \

http://www.gnu.org/philosophy/no-word-attachments.html

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


[R] Building Windows Package

2004-07-26 Thread Alan Arnholt
I am using R-1.9.1 with windows 2000 and trying to build a package.
However,
when I issue the command:

RCMD build --binary BSDA

I get:

  Building/Updating help pages for package 'BSDA'
 Formats: chm
hhc: not found
cp: cannot stat `C:/R191/R191/JUNK/BSDA/chm/BSDA.chm': No such file or
direc
tory
make[1]: *** [chm-BSDA] Error 1
make: *** [pkg-BSDA] Error 2
*** Installation of BSDA failed ***


My path is:

.;C:\RStools;C:\MinGW\bin;C:\perl\bin;C:\texmf\miktex\bin;C:\Rstools\zip.exe;
C:\Rstools\unzip.exe;C:\HTMLws\hhc.exe;C:\R191\R191\bin;%SystemRoot%\system32;
%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program
Files\CommonFiles\AdaptecShared\System;
C:\Program Files\ggobi;C:\Program Files\R\rw1091\library\Rggobi\libs

(HTML Help Workshop lives in- C:\HTMLws\hhc.exe)


I have the directory for HTML Help workshop in MkRules set as:

# Where does 'HTML Help Workshop' live? (unused if compiled HTML help is
# not requested. Spaces allowed.)
HHWDIR=C:/HTMLws

After I issue RCMD build --binary BSDA and get the error messages, if I go
to
`C:/R191/R191/JUNK/BSDA/chm/BSDA.hhp' and manually compile the file (with
HTML Help

workshop) then issue the command RCMD build --binary BSDA   again...the
package builds
without problems.  Any ideas what I am doing wrong?  Thanks in advance for
the help.


Alan




Alan T. Arnholt
Associate Professor
Dept. of Mathematical Sciences
Appalachian State University
2003-2004 International Exchange Scholar
Universidad Publica de Navarra - Nafarroako Unibertsitate Publikoa
Pamplona,  Spain

TEL : +34 948 169 205
CELL: +34 656 668 621

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


Re: [R] installing problems repeated.tgz linux

2004-07-26 Thread Marc Schwartz
On Mon, 2004-07-26 at 09:34, Christian Schulz wrote:
 Hi,
 
 i try several possibilities adn looking in the archive,
  but didn't getting success to install  j.lindsey's  usefuel library 
 repeated on my linux (suse9.0 with kernel 2.6.7,R.1.9.1)
 
 P.S. Windows, works  fine
 
 Many thanks for help
 Christian
 
 
 [EMAIL PROTECTED]:/space/downs R CMD INSTALL - l /usr/lib/R/library   repeated
 WARNING: invalid package '-'
 WARNING: invalid package 'l'
 WARNING: invalid package '/usr/lib/R/library'
 * Installing *source* package 'repeated' ...
 ** libs
 /usr/lib/R/share/make/shlib.mk:5: *** Target-Muster enthlt kein %.  
 Schluss.
 ERROR: compilation failed for package 'repeated'
 ** Removing '/usr/lib/R/library/repeated'

Christian,

There is a space (' ') between the '-' and the 'l', which will be parsed
as two separate arguments.  Hence the initial WARNING messages.

You need to use:

R CMD INSTALL -l /usr/lib/R/library repeated

Also note that you need to have 'root' privileges in order to install
the packages into the /usr/lib/R tree. Thus, you should 'su' to root
before running the command.

You should verify that your R tree is in /usr/lib, as the default is
/usr/local/lib, for which you would not require the '-l
/usr/lib/R/library' argument.

Presumably Windows worked fine because you typically do not require
administrator privileges to install the package locally on Windows or
your account has administrative privileges, which is typical (and bad)
on Windows NT/XP.

HTH,

Marc Schwartz

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


[R] ordering of levels.

2004-07-26 Thread Wolski
Hi!
Have the following factors with the following levels.
 tmp$norm
 [1] rank rank rank rank rank log  log  log  rank sqrt sqrt sqrt log  log  rank
[16] rank rank sqrt sqrt sqrt sqrt log  log  log  log  sqrt none none none none
[31] none none none none sqrt none
Levels: log none rank sqrt

I would like to add an ordering to the levels.
nonesqrtlogrank

I tried with 
tmp$norm -factor(tmp$norm,labels = c(none,sqrt,log,rank),ordered=T)
tmp$norm
 [1] log  log  log  log  log  none none none log  rank rank rank none none log 
[16] log  log  rank rank rank rank none none none none rank sqrt sqrt sqrt sqrt
[31] sqrt sqrt sqrt sqrt rank sqrt
Levels: none  sqrt  log  rank

But this is not what I would like to have because the command not only superimposes an 
ordering but also changes the factors!

Eryk

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


RE: [R] installing problems repeated.tgz linux

2004-07-26 Thread Liaw, Andy
Sorry, Christian.  I have no idea what those error messages in German say.

Andy

 From: [EMAIL PROTECTED] 
 
 Hello,
 
  thanks for your and Marc's hint, but it seems not the probleme!?
 Is there any  probleme with my make?
 
 many thanks and regards, 
 christian
 
 
 [EMAIL PROTECTED]:/usr/lib/R R CMD INSTALL 
 -l /usr/lib/R/library  /space/downs/repeated.tgz
 * Installing *source* package 'repeated' ...
 ** libs
 /usr/lib/R/share/make/shlib.mk:5: *** Target-Muster enthält 
 kein »%«.  
 Schluss.
 ERROR: compilation failed for package 'repeated'
 ** Removing '/usr/lib/R/library/repeated'
 
 [EMAIL PROTECTED]:/usr/lib/R R CMD INSTALL 
 -l /usr/lib/R/library  /space/downs/repeated
 * Installing *source* package 'repeated' ...
 ** libs
 /usr/lib/R/share/make/shlib.mk:5: *** Target-Muster enthält 
 kein »%«.  
 Schluss.
 ERROR: compilation failed for package 'repeated'
 ** Removing '/usr/lib/R/library/repeated'
 
 ...with your great RandomForest and other packages 
 it works!
 
 [EMAIL PROTECTED]:/usr/lib/R R CMD INSTALL 
 -l /usr/lib/R/library  /space/downs/randomForest*.tar.gz
 * Installing *source* package 'randomForest' ...
 ** libs
 gcc -I/usr/lib/R/include  -I/usr/local/include -I/opt/gnome/include 
 -D__NO_MATH_INLINES -mieee-fp  -fPIC   -c regrf.c -o regrf.o
 g77 -mieee-fp  -fPIC   -c regrfsub.f -o regrfsub.o
 gcc -I/usr/lib/R/include  -I/usr/local/include -I/opt/gnome/include 
 -D__NO_MATH_INLINES -mieee-fp  -fPIC   -c rf.c -o rf.o
 g77 -mieee-fp  -fPIC   -c rfsub.f -o rfsub.o
 gcc -shared -L/usr/local/lib -L/opt/gnome/lib -o 
 randomForest.so regrf.o 
 regrfsub.o rf.o rfsub.o  -L/usr/local/lib -L/opt/gnome/lib 
 -L/usr/lib/gcc-lib/i586-suse-linux/3.3.1 
 -L/usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../../../i586-suse
 -linux/lib 
 -L/usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../.. -lfrtbegin 
 -lg2c -lm 
 -lgcc_s -L/usr/lib/R/bin -lR
 ** R
 ** inst
 ** help
   Building/Updating help pages for package 'randomForest'
  Formats: text html latex example
   MDSplot   texthtmllatex   example
   combine   texthtmllatex   example
   getTree   texthtmllatex   example
   grow  texthtmllatex   example
   importancetexthtmllatex
   margintexthtmllatex   example
   na.roughfix   texthtmllatex   example
   partialPlot   texthtmllatex   example
   plot.randomForest texthtmllatex   example
   predict.randomForest  texthtmllatex   example
   randomForest  texthtmllatex   example
   rfImpute  texthtmllatex   example
   treesize  texthtmllatex   example
   tuneRFtexthtmllatex   example
   varImpPlottexthtmllatex   example
   varUsed   texthtmllatex   example
 * DONE (randomForest)
 
 
 
 
 
 
 Am Montag, 26. Juli 2004 18:56 schrieb Liaw, Andy:
   From: Christian Schulz
  
   Hi,
  
   i try several possibilities adn looking in the archive,
but didn't getting success to install  j.lindsey's  
 usefuel library
   repeated on my linux (suse9.0 with kernel 2.6.7,R.1.9.1)
  
   P.S. Windows, works  fine
  
   Many thanks for help
   Christian
  
R CMD INSTALL - l /usr/lib/R/library   repeated
 
 ^
  Try again without that space.
 
  Andy
 
 
 
  
 --
 -
 --- Notice:  This e-mail message, together with any 
 attachments, contains
  information of Merck  Co., Inc. (One Merck Drive, 
 Whitehouse Station, New
  Jersey, USA 08889), and/or its affiliates (which may be 
 known outside the
  United States as Merck Frosst, Merck Sharp  Dohme or MSD 
 and in Japan, as
  Banyu) that may be confidential, proprietary copyrighted 
 and/or legally
  privileged. It is intended solely for the use of the 
 individual or entity
  named on this message.  If you are not the intended 
 recipient, and have
  received this message in error, please notify us 
 immediately by reply
  e-mail and then delete it from your system.
  
 --
 -
 ---
 


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


Re: [R] ordering of levels.

2004-07-26 Thread Sundar Dorai-Raj

Wolski wrote:
Hi!
Have the following factors with the following levels.
 tmp$norm
 [1] rank rank rank rank rank log  log  log  rank sqrt sqrt sqrt log  log  rank
[16] rank rank sqrt sqrt sqrt sqrt log  log  log  log  sqrt none none none none
[31] none none none none sqrt none
Levels: log none rank sqrt
I would like to add an ordering to the levels.
nonesqrtlogrank
I tried with 
tmp$norm -factor(tmp$norm,labels = c(none,sqrt,log,rank),ordered=T)

tmp$norm
 [1] log  log  log  log  log  none none none log  rank rank rank none none log 
[16] log  log  rank rank rank rank none none none none rank sqrt sqrt sqrt sqrt
[31] sqrt sqrt sqrt sqrt rank sqrt
Levels: none  sqrt  log  rank

But this is not what I would like to have because the command not only superimposes an 
ordering but also changes the factors!
Eryk
Eryk,
  See ?factor or ?ordered which will help. I think what you want is:
lev - c(none, sqrt, log, rank)
tmp$norm - ordered(tmp$norm, levels = lev)
or
tmp$norm - factor(tmp$norm, levels = lev, ordered = TRUE)
Note the use of levels and not labels.
--sundar
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] aggregate function

2004-07-26 Thread Gabor Grothendieck

[Sorry if this gets posted twice.  I have been having some
problems with gmane posting.]

We can use rowsum like this:

 rowsum(frame$Total * (frame[,3:5]0), frame$Year)

Tus Whi Norw
1994 1 0.00 1
1995 1 1.00 1
1997 2 4.00 5
1998 0 0.00 1
1999 1 2.04 2

Note that only years that are actually present will be in the
resulting matrix. 1996 is not in the sample data in your post
so there is no row for 1996. If that's not a problem or if your 
real data covers all the years anyways we are done.

If missing years is a problem then merge in some zero rows with
the years first. The first two lines below do this and the third 
line is the same as the line above:

 frame - merge(frame, 1994:1999, by = 1, all = TRUE)
 frame[is.na(frame)] - 0

 rowsum(frame$Total * (frame[,3:5]0), frame$Year)

Tus Whi Norw
1994 1 0.00 1
1995 1 1.00 1
1996 0 0.00 0 -- now we have a row for 1996
1997 2 4.00 5
1998 0 0.00 1
1999 1 2.04 2


Luis Rideau Cruz [EMAIL PROTECTED] :

I have the folowing frame(there are more columns than shown),
1 2 3 4 5
Year Total Tus Whi Norw
1994 1.00 1830 0 355
1995 1.00 0 0 0
1995 1.00 0 0 0
1995 1.00 4910 4280 695
1997 1.00 0 0 110
1997 0.58 0 0 0
1997 1.00 0 0 0
1994 1.00 0 0 0
1997 1.00 0 40 70
1998 1.00 0 0 1252
1999 1.04 0 74 0
1999 1.00 0 0 0
1999 1.02 0 0 0
1999 1.00 0 0 0
1999 1.00 0 0 171
1999 1.00 1794 0 229
1999 1.00 0 3525 0
1997 1.00 1335 1185 147
1997 1.00 4925 1057 4801
1997 1.00 0 6275 1773

I try to get sum(Total) by Year in which Tus0, sum(Total) by Year in which 
Whi0,,,and so on.

I have done something like this;

a-as.list(numeric(3))
for (i in 3:5)
{
a[[i]]-aggregate(frame[,Total],list(Year=frame$Year,
Tus=frame$i0),sum)
}

But I get

Error in FUN(X[[as.integer(1)]], ...) : arguments must have same length

Also by doing one by one

aggregate(frame[,Total],list(Year=frame$Year,
Tus=frame$Tus0),sum)


The result is something like;

Year Tus x
1994 FALSE 49.69
1995 FALSE 49.35
1996 FALSE 56.95
1997 FALSE 57.00
1998 FALSE 57.00
1999 FALSE 58.09
2000 FALSE 56.97
2001 FALSE 57.95
2002 FALSE 57.10
2003 FALSE 56.16
2000 TRUE 1.00
2002 TRUE 1.00
2003 TRUE 2.01

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


RE: [R] installing problems repeated.tgz linux

2004-07-26 Thread Liaw, Andy
I downloaded repeated.tgz and tried it myself on one of our AMD Opterons
running SLES8, and it worked (R-1.9.1 compiled as 64-bit).  Notice that I do
get a couple of warnings from gcc about labels, and from g77 about the use
of `sum' function.

Andy

[EMAIL PROTECTED]:lindsey]% R CMD INSTALL -l ~/rlibs repeated
* Installing *source* package 'repeated' ...
** libs
g77   -fPIC  -O2 -m64 -msse2 -march=k8 -mcpu=k8 -g -c chidden.f -o chidden.o
g77   -fPIC  -O2 -m64 -msse2 -march=k8 -mcpu=k8 -g -c cphidden.f -o
cphidden.o
gcc -I/usr/local/lib/R/include  -I/usr/local/include   -fPIC  -O7 -m64
-msse2 -march=k8 -mcpu=k8 -g -c cutil.c -o cutil.o
gcc -I/usr/local/lib/R/include  -I/usr/local/include   -fPIC  -O7 -m64
-msse2 -march=k8 -mcpu=k8 -g -c dist.c -o dist.o
gcc -I/usr/local/lib/R/include  -I/usr/local/include   -fPIC  -O7 -m64
-msse2 -march=k8 -mcpu=k8 -g -c gar.c -o gar.o
g77   -fPIC  -O2 -m64 -msse2 -march=k8 -mcpu=k8 -g -c hidden.f -o hidden.o
gcc -I/usr/local/lib/R/include  -I/usr/local/include   -fPIC  -O7 -m64
-msse2 -march=k8 -mcpu=k8 -g -c kcountb.c -o kcountb.o
kcountb.c: In function `kcountb':
kcountb.c:263: warning: deprecated use of label at end of compound statement
kcountb.c:270: warning: deprecated use of label at end of compound statement
gcc -I/usr/local/lib/R/include  -I/usr/local/include   -fPIC  -O7 -m64
-msse2 -march=k8 -mcpu=k8 -g -c kserieb.c -o kserieb.o
g77   -fPIC  -O2 -m64 -msse2 -march=k8 -mcpu=k8 -g -c logitord.f -o
logitord.o
g77   -fPIC  -O2 -m64 -msse2 -march=k8 -mcpu=k8 -g -c binnest.f -o binnest.o
binnest.f: In subroutine `calcbn':
binnest.f:537: warning:
J_Prod = J_Prod * Sum(H2,uph2) ! Calculate the product
of J
  ^
Reference to unimplemented intrinsic `SUM' at (^) (assumed EXTERNAL)
binnest.f: In subroutine `calcbn2':
binnest.f:1255: warning:
J_Prod = J_Prod * Sum(H2,uph2) ! Calculate the product
of J
  ^
Reference to unimplemented intrinsic `SUM' at (^) (assumed EXTERNAL)
g77   -fPIC  -O2 -m64 -msse2 -march=k8 -mcpu=k8 -g -c gausscop.f -o
gausscop.o
gcc -I/usr/local/lib/R/include  -I/usr/local/include   -fPIC  -O7 -m64
-msse2 -march=k8 -mcpu=k8 -g -c gaps.c -o gaps.o
gcc -I/usr/local/lib/R/include  -I/usr/local/include   -fPIC  -O7 -m64
-msse2 -march=k8 -mcpu=k8 -g -c calcs.c -o calcs.o
gcc -I/usr/local/lib/R/include  -I/usr/local/include   -fPIC  -O7 -m64
-msse2 -march=k8 -mcpu=k8 -g -c calcs1.c -o calcs1.o
gcc -I/usr/local/lib/R/include  -I/usr/local/include   -fPIC  -O7 -m64
-msse2 -march=k8 -mcpu=k8 -g -c calcs2.c -o calcs2.o
gcc -I/usr/local/lib/R/include  -I/usr/local/include   -fPIC  -O7 -m64
-msse2 -march=k8 -mcpu=k8 -g -c calcs3.c -o calcs3.o
gcc -I/usr/local/lib/R/include  -I/usr/local/include   -fPIC  -O7 -m64
-msse2 -march=k8 -mcpu=k8 -g -c calcs4.c -o calcs4.o
gcc -shared -o repeated.so chidden.o cphidden.o cutil.o dist.o gar.o
hidden.o kcountb.o kserieb.o logitord.o binnest.o gausscop.o gaps.o calcs.o
calcs1.o calcs2.o calcs3.o calcs4.o -L/usr/local/lib
-L/opt/gcc33/lib64/gcc-lib/x86_64-suse-linux/3.3
-L/opt/gcc33/lib64/gcc-lib/x86_64-suse-linux/3.3/../../../../lib64
-L/opt/gcc33/lib64/gcc-lib/x86_64-suse-linux/3.3/../../.. -L/lib/../lib64
-L/usr/lib/../lib64 -lfrtbegin -lg2c -lm -lgcc_s
** R
** help
  Building/Updating help pages for package 'repeated'
 Formats: text html latex example 
[snipped.  I think you get the idea...]


 From: Liaw, Andy
 
 Sorry, Christian.  I have no idea what those error messages 
 in German say.
 
 Andy
 
  From: [EMAIL PROTECTED] 
  
  Hello,
  
   thanks for your and Marc's hint, but it seems not the probleme!?
  Is there any  probleme with my make?
  
  many thanks and regards, 
  christian
  
  
  [EMAIL PROTECTED]:/usr/lib/R R CMD INSTALL 
  -l /usr/lib/R/library  /space/downs/repeated.tgz
  * Installing *source* package 'repeated' ...
  ** libs
  /usr/lib/R/share/make/shlib.mk:5: *** Target-Muster enthält 
  kein »%«.  
  Schluss.
  ERROR: compilation failed for package 'repeated'
  ** Removing '/usr/lib/R/library/repeated'
  
  [EMAIL PROTECTED]:/usr/lib/R R CMD INSTALL 
  -l /usr/lib/R/library  /space/downs/repeated
  * Installing *source* package 'repeated' ...
  ** libs
  /usr/lib/R/share/make/shlib.mk:5: *** Target-Muster enthält 
  kein »%«.  
  Schluss.
  ERROR: compilation failed for package 'repeated'
  ** Removing '/usr/lib/R/library/repeated'
  
  ...with your great RandomForest and other packages 
  it works!
  
  [EMAIL PROTECTED]:/usr/lib/R R CMD INSTALL 
  -l /usr/lib/R/library  /space/downs/randomForest*.tar.gz
  * Installing *source* package 'randomForest' ...
  ** libs
  gcc -I/usr/lib/R/include  -I/usr/local/include -I/opt/gnome/include 
  -D__NO_MATH_INLINES -mieee-fp  -fPIC   -c regrf.c -o regrf.o
  g77 -mieee-fp  -fPIC   -c regrfsub.f -o regrfsub.o
  gcc -I/usr/lib/R/include  -I/usr/local/include -I/opt/gnome/include 
  -D__NO_MATH_INLINES -mieee-fp  -fPIC   -c rf.c -o rf.o
  g77 

Re: [R] ordering of levels.

2004-07-26 Thread Wolski
Hi!
Thanks a lot.
Eryk

*** REPLY SEPARATOR  ***

On 7/26/2004 at 2:07 PM Sundar Dorai-Raj wrote:

Wolski wrote:

 Hi!
 Have the following factors with the following levels.
  tmp$norm
  [1] rank rank rank rank rank log  log  log  rank sqrt sqrt sqrt log 
log  rank
 [16] rank rank sqrt sqrt sqrt sqrt log  log  log  log  sqrt none none
none none
 [31] none none none none sqrt none
 Levels: log none rank sqrt
 
 I would like to add an ordering to the levels.
 nonesqrtlogrank
 
 I tried with 
 tmp$norm -factor(tmp$norm,labels =
c(none,sqrt,log,rank),ordered=T)
 
tmp$norm
 
  [1] log  log  log  log  log  none none none log  rank rank rank none
none log 
 [16] log  log  rank rank rank rank none none none none rank sqrt sqrt
sqrt sqrt
 [31] sqrt sqrt sqrt sqrt rank sqrt
 Levels: none  sqrt  log  rank
 
 But this is not what I would like to have because the command not only
superimposes an ordering but also changes the factors!
 
 Eryk
 

Eryk,
   See ?factor or ?ordered which will help. I think what you want is:

lev - c(none, sqrt, log, rank)
tmp$norm - ordered(tmp$norm, levels = lev)

or

tmp$norm - factor(tmp$norm, levels = lev, ordered = TRUE)

Note the use of levels and not labels.

--sundar



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


Re: [R] Building Windows Package

2004-07-26 Thread Prof Brian Ripley
You want the directory in your path specification, not the executables.  
As in

.;C:\RStools;C:\MinGW\bin;C:\perl\bin;C:\texmf\miktex\bin;
C:\HTMLws;C:\R191\R191\bin;%SystemRoot%\system32;
%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program 
Files\CommonFiles\AdaptecShared\System;
C:\Program Files\ggobi;C:\Program Files\R\rw1091\library\Rggobi\libs


On Mon, 26 Jul 2004, Alan Arnholt wrote:

 I am using R-1.9.1 with windows 2000 and trying to build a package.
 However,
 when I issue the command:
 
 RCMD build --binary BSDA
 
 I get:
 
   Building/Updating help pages for package 'BSDA'
  Formats: chm
 hhc: not found
 cp: cannot stat `C:/R191/R191/JUNK/BSDA/chm/BSDA.chm': No such file or
 direc
 tory
 make[1]: *** [chm-BSDA] Error 1
 make: *** [pkg-BSDA] Error 2
 *** Installation of BSDA failed ***
 
 
 My path is:
 
 .;C:\RStools;C:\MinGW\bin;C:\perl\bin;C:\texmf\miktex\bin;C:\Rstools\zip.exe;
 C:\Rstools\unzip.exe;C:\HTMLws\hhc.exe;C:\R191\R191\bin;%SystemRoot%\system32;
 %SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program
 Files\CommonFiles\AdaptecShared\System;
 C:\Program Files\ggobi;C:\Program Files\R\rw1091\library\Rggobi\libs
 
 (HTML Help Workshop lives in- C:\HTMLws\hhc.exe)
 
 
 I have the directory for HTML Help workshop in MkRules set as:
 
 # Where does 'HTML Help Workshop' live? (unused if compiled HTML help is
 # not requested. Spaces allowed.)
 HHWDIR=C:/HTMLws
 
 After I issue RCMD build --binary BSDA and get the error messages, if I go
 to
 `C:/R191/R191/JUNK/BSDA/chm/BSDA.hhp' and manually compile the file (with
 HTML Help
 
 workshop) then issue the command RCMD build --binary BSDA   again...the
 package builds
 without problems.  Any ideas what I am doing wrong?  Thanks in advance for
 the help.
 
 
 Alan
 
 
 
 
 Alan T. Arnholt
 Associate Professor
 Dept. of Mathematical Sciences
 Appalachian State University
 2003-2004 International Exchange Scholar
 Universidad Publica de Navarra - Nafarroako Unibertsitate Publikoa
 Pamplona,  Spain
 
 TEL : +34 948 169 205
 CELL: +34 656 668 621
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 
 

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

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


RE: [R] installing problems repeated.tgz linux

2004-07-26 Thread Marc Schwartz
I echo Andy's experience on FC2. I was able to install the package here
and got the same warning messages.

Despite trying to use some web sites to translate the german text, I am
unsure of the 'true' meaning. I think it is something pertaining to
target patterns not being found, which leads me to think that this might
be a locale/character encoding issue in the package.

Anyone?

Marc

On Mon, 2004-07-26 at 14:16, Liaw, Andy wrote:
 I downloaded repeated.tgz and tried it myself on one of our AMD Opterons
 running SLES8, and it worked (R-1.9.1 compiled as 64-bit).  Notice that I do
 get a couple of warnings from gcc about labels, and from g77 about the use
 of `sum' function.
 
 Andy

SNIPPED

  From: Liaw, Andy
  
  Sorry, Christian.  I have no idea what those error messages 
  in German say.
  
  Andy
  
   From: [EMAIL PROTECTED] 
   
   Hello,
   
thanks for your and Marc's hint, but it seems not the probleme!?
   Is there any  probleme with my make?
   
   many thanks and regards, 
   christian
   
   
   [EMAIL PROTECTED]:/usr/lib/R R CMD INSTALL 
   -l /usr/lib/R/library  /space/downs/repeated.tgz
   * Installing *source* package 'repeated' ...
   ** libs
   /usr/lib/R/share/make/shlib.mk:5: *** Target-Muster enthlt 
   kein %.  
   Schluss.
   ERROR: compilation failed for package 'repeated'
   ** Removing '/usr/lib/R/library/repeated'
   
   [EMAIL PROTECTED]:/usr/lib/R R CMD INSTALL 
   -l /usr/lib/R/library  /space/downs/repeated
   * Installing *source* package 'repeated' ...
   ** libs
   /usr/lib/R/share/make/shlib.mk:5: *** Target-Muster enthlt 
   kein %.  
   Schluss.
   ERROR: compilation failed for package 'repeated'
   ** Removing '/usr/lib/R/library/repeated'

SNIPPED

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


RE: [R] choosing constraints for function optim method=L-BFGS-B whenthey are in terms of other parameter values

2004-07-26 Thread Ingmar Visser
Hi Tom,

I am not entirely sure what the problem, you haven't been very specific.
If you want general linear constraints on your parameters, ie linear combinations of 
parameters summing to some value, constrOptim may be of help.

hth, ingmar

Ingmar Visser
Developmental Processes Research Group
Department of Psychology
University of Amsterdam
http://users.fmg.uva.nl/ivisser/



-Original Message-
From: [EMAIL PROTECTED] on behalf of Tom Stone
Sent: Mon 7/26/2004 4:57 PM
To: [EMAIL PROTECTED]
Subject: [R] choosing constraints for function optim method=L-BFGS-B whenthey are in 
terms of other parameter values
 
I have a function of several variables which I wish to minimise over four
variables, two of the upper bounds for which are defined in terms of other
variables in the model over which minimisation will take place. I cannot
work out how to code this in such a way as to avoid getting an error message
when I run the code.

If anyone can provide any assistance I will be most grateful.

Best Regards

Tom Stone

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

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


[R] spec.pgram() possible bug

2004-07-26 Thread David Stoffer

 test=spec.pgram(rnorm(128,0,1), kernel(daniell,1))
 test$df
[1] 5.374771

df should be 6= 2*(2*m+1) where m=1 in this case

... and so on

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


[R] Significance Test for Correlation Coefficients

2004-07-26 Thread Matt McCall
Hello all,
I have a set of  microarray timeseries (approx. 18000 genes and 7 time 
points per gene) data that I have correlated with a template (a vector 
of length 7).  I have also correlated random data from a normal 
distribution with the same mean and standard deviation as my data set 
with the template, as well as, correlating a random permutation of my 
data set with the template.  So I now have 3 vectors of length 18000 
contains correlation coefficients.  I was wondering if there was a test 
in R to determine if the correlation coefficients are significantly 
different.  In particular, I want to compare the correlation 
coefficients from my data set with each of the other two.  Thank you 
for any help you can give me.
Sincerely,
Matt

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


[R] Problem with a while loop embedded in a function.

2004-07-26 Thread [EMAIL PROTECTED]

Hello all. 

I have been working on a (fairly simple) function for way too long. I’ve really hit a 
wall and I was hoping someone might be able to point me in the right direction. 

 

I have (attempted) to create a function that has an embedded while loop. The while 
loop works fine by itself, however, when the while loop is embedded in the function, 
the function fails. I’m not sure why this happens as the function really doesn’t add 
much above and beyond the while loop. I believe it might have something to do with the 
list I define in the while loop as ‘nlme.control.parms.’ Because I included 
print(nlme.control.parms) when the while loop runs by itself the paramers of 
nlme.control.parms can be seen to be fine. However, when I run the function 
print(nlme.control.parms) is full of NAs. I’m not sure if the function fails because 
the list nlme.control.parms is full of NAs or if nlme.control.parms is full of NAs 
because the function failed. 

 

I should mention that the function is (supposed to be!) used with nlme so that 
multiple sets of parameters can be defined (each next set being less restrictive than 
the previous), and nlme runs until it outputs results given the particular set of 
parameters. The values I used in the simplified example that follows would never be 
used in a real situation, but for purposes of this illustrative example, the 
parameters are fine. The result should be a list of the nlme object and 'OK' (which 
should be 5 for the example). I'm using R version 1.9.1 on Windows XP.

 

Thanks for any thoughts, Ken

 



library(nlme)

data(Loblolly)

 

maxIter - c(1, 1, 1, 1, 1)

returnObject - c(FALSE, FALSE, FALSE, FALSE, TRUE)

 

nlsList.Object - nlsList(SSasymp, Loblolly)

 

M1 - function(maxIter, returnObject)

{

 

ok - FALSE

OK - 0

 

while(ok==FALSE)

{

OK - OK + 1  

 

nlme.control.parms - list(maxIter=maxIter[OK], returnObject=returnObject[OK])

 

fm1 - try(nlme(nlsList.Object,

fixed = Asym + R0 + lrc ~ 1,

random = Asym ~ 1,

control = nlme.control.parms), silent=TRUE)

  

ok - is.numeric(fm1$numIter)

print(OK)

print(nlme.control.parms)

}

return(list(fm1, OK))

}

 

Test - M1(maxIter=maxIter, returnObject=returnObject)



-


[[alternative HTML version deleted]]

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


Re: [R] spec.pgram() possible bug

2004-07-26 Thread Prof Brian Ripley
Perhaps you could take the trouble to read the references (or the code)?
Hint: do you know about tapering and how to work out its effect?

On Mon, 26 Jul 2004, David Stoffer wrote:

  test=spec.pgram(rnorm(128,0,1), kernel(daniell,1))
  test$df
 [1] 5.374771
 
 df should be 6= 2*(2*m+1) where m=1 in this case
 
 ... and so on

 spec.pgram(rnorm(128,0,1), kernel(daniell,1), taper=0)$df
[1] 6

is what you have calculated, inappropriately for the call you 
actually used.

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

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


Re: [R] binning a vector

2004-07-26 Thread Andrew Robinson
Also, you can use cut and tapply to calculate means by bins.  

Andrew

- Original Message -
From: Deepayan Sarkar [EMAIL PROTECTED]
Date: Tuesday, July 27, 2004 3:38 am
Subject: Re: [R] binning a vector

 On Monday 26 July 2004 10:11, [EMAIL PROTECTED] wrote:
  Hello,
 
  I was wondering wether there's a function in R that takes two 
 vectors (of same length) as input and computes mean values for bins
  (intervals) or even a sliding window over these vectros.
 
  I've several x/y data set (input/response) that I'd like plot
  together. Say the x-data for one data set goes from -5 to 14 with
  12,000 values, then I'd like to bin the x-vector in steps of +1 and
  calculate and plot the mean of the x-values and the y-values within
  each bin.
 
  I was browsing the R-docs but couldn't find anything appropiate.
 
 Do you know about loess? It's not exactly what you describe, but 
 maybe 
 it's what you really want.
 
 Deepayan
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-
 guide.html

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


Re: [R] Building Windows Package

2004-07-26 Thread Alan Arnholt
Thanks.  It works great now!

Alan

Alan T. Arnholt
Associate Professor
Dept. of Mathematical Sciences
Appalachian State University
2003-2004 International Exchange Scholar
Universidad Publica de Navarra - Nafarroako Unibertsitate Publikoa
Pamplona,  Spain

TEL : +34 948 169 205
CELL: +34 656 668 621

On Mon, 26 Jul 2004, Prof Brian Ripley wrote:

 You want the directory in your path specification, not the executables.
 As in

 .;C:\RStools;C:\MinGW\bin;C:\perl\bin;C:\texmf\miktex\bin;
 C:\HTMLws;C:\R191\R191\bin;%SystemRoot%\system32;
 %SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program
 Files\CommonFiles\AdaptecShared\System;
 C:\Program Files\ggobi;C:\Program Files\R\rw1091\library\Rggobi\libs


 On Mon, 26 Jul 2004, Alan Arnholt wrote:

  I am using R-1.9.1 with windows 2000 and trying to build a package.
  However,
  when I issue the command:
 
  RCMD build --binary BSDA
 
  I get:
 
Building/Updating help pages for package 'BSDA'
   Formats: chm
  hhc: not found
  cp: cannot stat `C:/R191/R191/JUNK/BSDA/chm/BSDA.chm': No such file or
  direc
  tory
  make[1]: *** [chm-BSDA] Error 1
  make: *** [pkg-BSDA] Error 2
  *** Installation of BSDA failed ***
 
 
  My path is:
 
  .;C:\RStools;C:\MinGW\bin;C:\perl\bin;C:\texmf\miktex\bin;C:\Rstools\zip.exe;
  C:\Rstools\unzip.exe;C:\HTMLws\hhc.exe;C:\R191\R191\bin;%SystemRoot%\system32;
  %SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program
  Files\CommonFiles\AdaptecShared\System;
  C:\Program Files\ggobi;C:\Program Files\R\rw1091\library\Rggobi\libs
 
  (HTML Help Workshop lives in- C:\HTMLws\hhc.exe)
 
 
  I have the directory for HTML Help workshop in MkRules set as:
 
  # Where does 'HTML Help Workshop' live? (unused if compiled HTML help is
  # not requested. Spaces allowed.)
  HHWDIR=C:/HTMLws
 
  After I issue RCMD build --binary BSDA and get the error messages, if I go
  to
  `C:/R191/R191/JUNK/BSDA/chm/BSDA.hhp' and manually compile the file (with
  HTML Help
 
  workshop) then issue the command RCMD build --binary BSDA   again...the
  package builds
  without problems.  Any ideas what I am doing wrong?  Thanks in advance for
  the help.
 
 
  Alan
 
 
 
 
  Alan T. Arnholt
  Associate Professor
  Dept. of Mathematical Sciences
  Appalachian State University
  2003-2004 International Exchange Scholar
  Universidad Publica de Navarra - Nafarroako Unibertsitate Publikoa
  Pamplona,  Spain
 
  TEL : +34 948 169 205
  CELL: +34 656 668 621
 
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 
 

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



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


RE: [R] R on AMD64 (Opteron)

2004-07-26 Thread Liaw, Andy
 From: Jerome Asselin 
 
 From: Liaw, Andy [EMAIL PROTECTED]
 
  Just one more thing for folks intending to try Opterons with 1 cpu:
 You'll
  probably want to use a NUMA kernel, rather than a SMP one.
 
  Cheers,
  Andy
 
 Thanks for the advice, but is there another reason why you 
 write this beside
 a large (I mean 8) number of CPUs?
 
 At http://lse.sourceforge.net/numa/faq/ I read,
 
 What is the difference between NUMA and SMP?
 The NUMA architecture was designed to surpass the scalability 
 limits of the
 SMP architecture. With SMP, which stands for Symmetric 
 Multi-Processing, all
 memory access are posted to the same shared memory bus. This 
 works fine for
 a relatively small number of CPUs, but the problem with the shared bus
 appears when you have dozens, even hundreds, of CPUs 
 competing for access to
 the shared memory bus. NUMA alleviates these bottlenecks by 
 limiting the
 number of CPUs on any one memory bus, and connecting the 
 various nodes by
 means of a high speed interconnect.

I was told by folks at Penguin Computing (where we bought our Opterons) and
AMD that because of the way memory controller is integrated in the Opteron,
when running two CPU intensive processes on a dual CPU box, one cpu will be
at near 100% while the other will be only around 90%, if you use a SMP
kernel.  Indeed that's what we saw when we ran two R processes
simultaneously.  Switching to the NUMA kernel for the most part `solves'
that problem.

Andy

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


[R] qcc package syndromic surveillance (multivar CUSUM?)

2004-07-26 Thread adiamond
Dear R Community:

I am working on a public health early warning system, and 
I see that the qcc package allows for CUSUM and other statistical quality tests
but I am not sure if my project is a good match for qcc functions as written.
Any advice you may have is very much appreciated.

I have four years worth of daily counts of emergency room admissions for 
different conditions (e.g. respiratory, neurologic, etc) from several local 
hospitals.  the data looks like this...

DAY 1
  Respiratory Neuro   ...
Hospital A:   1012
.  . .
.  . .
Hospital F:714


DAY 2 Respiratory Neuro   ...
Hospital A:   1012
.  . .
.  . .
Hospital F:714...

etc.,

and my goal is to do a kind of multivariate quality control test (without 
fitting a GLM), that would run each day after the data is updated and be able 
to answer the question: 
Has there been a significant variation in the central tendency of the data?

An analogous problem would be detecting the early signs of a shift in global 
trading patterns by examining stock market indexes in different countries 
around the world, updating and testing the data each business day. 

Thank you, 

Alexis Diamond

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


[R] bad restore file magic number

2004-07-26 Thread Jordan Irvin
I'm running R 1.9.1 and trying to load a macro I've written.  It gives the e
Error: bad restore file magic number (file may be corrupted)-- no data
loaded

what does this error mean, and how can I fix this problem.

thanks,
jordan

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


Re: [R] bad restore file magic number

2004-07-26 Thread Jeff Gentry
 I'm running R 1.9.1 and trying to load a macro I've written.  It gives the e
 Error: bad restore file magic number (file may be corrupted)-- no data
 loaded

You probably want to use source() here, if you have the code in a
file.  The load() command is for use with stuff saved via the
save() command.

-J

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


[R] covariate selection in cox model (counting process)

2004-07-26 Thread Mayeul KAUFFMANN
Thank you a lot for your time and your answer, Thomas. Like all good
answers, it raised new questions for me ;-)

In the case of recurrent events coxph() is not
 using maximum likelihood or even maximum partial likelihood. It is
 maximising the quantity that (roughly speaking) would be the partial
 likelihood if the covariates explained all the cluster differences.

I could have non repeating events by removing countries once they have
experienced a war. But I'm not sure it will change the estimation
procedure since this will change the dataset only, not the formula
coxph(Surv(start,stop,status)~x1+x2+...+cluster(id),robust=T)

I am not sure I understood you well: do you really mean recurrent events
alone or any counting process notation (including allowing for recurrent
events).


I thought the counting process notation did not differ really from the Cox
model in R, since Terry M. Therneau (A Package for Survival Analysis in S,
April 22, 1996) concludes his mathematical section 3.3 Cox Model by The
above notation is derived from the counting process representation [...]
It allows very naturally for several extensions to the original Cox model
formulation: multiple events per subject, discontinuous intervals of risk
[...],left truncation. (I used it to introduce 1. time-dependent
covariates, some covariates changing yearly, other irregularly, and 2.
left truncation: not all countries existed at the beginning of the study)


In the case of recurrent events coxph() is not
 using maximum likelihood or even maximum partial likelihood.

Then, what does fit$loglik give in this case? Still a likelihood or a
valid criterion to maximise ?
If not, how to get (manually) the criterion that was maximsed?

That's of interest for me since
 I created artificial covariates measuring the proximity since some
events: exp(-days.since.event/a.chosen.parameter).

...and I used fit$loglik to chose a.chosen.parameter from 8 values, for 3
types of events:


la-c(263.5, 526.9,1053.9,2107.8,4215.6,8431.1) #list of values to choose
from
z-NULL;for(a1 in la) for(a2 in la) for(a3 in la) {coxtmp -
(coxph(Surv(start,stop,status)~
+I(exp(-days.since.event.of.type.one/a1))
+I(exp(-days.since.event.of.type.two/a2))
+I(exp(-days.since.event.of.type.three/a3))
+ other.time.dependent.covariates
+cluster(id)
,data=x,robust=T))
rbind(z,c(a1,a2,a3,coxtmp$wald.test, coxtmp$rscore, coxtmp$loglik,
coxtmp$score))-z
}
z - data.frame(z)
names(z) - c(a1,a2, a3,wald.test, rscore,
NULLloglik,loglik, score)
z[which.max(z$rscore),]
z[which.max(z$loglik),]

The last two commands gave me almost always the same set for c(a1,a2,a3).
But they sometimes differed significantly on some models.

Which criteria (if any ?!) should I use to select the best set c(a1,a2,a3)
?


(If you wish to see what the proximity variables look like, run the
following code. The dashed lines show the half life of the proximity
variable,here=6 months, which is determined by a.chosen.parameter, e.g.
a1=la[1]:
#start of code
curve(exp(-(x)/263.5),0,8*365.25,xlab=number of days since last political
regime change (dsrc),ylab=Proximity of political regime change =
exp(-dsrc/263.5),las=1)
axis(1,at=365.25/2, labels= (6 months));axis(2,at=seq(0,1,.1),las=1)
lines(c(365.25/2,365.25/2,-110),c(-.05,0.5,0.5),lty=dashed)
#end of code)



Thanks a lot again.

Mayeul KAUFFMANN
Univ. Pierre Mendes France
Grenoble - France

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


[R] lattice / pdf bug ?

2004-07-26 Thread Dirk Eddelbuettel

I've been scrathing my head over this one.  Suppose I have a data.frame
which maps to a 'n x k' lattice, and that one of those cells is empty.

An artificial example is generated by

Q-data.frame(x1=sample(c(A,B),10,replace=TRUE),
  x2=c(C, rep(D,9)), y=rnorm(10))

where by having only one obs. for the first level of the second factor x2,
we ensure that there won't be full combinations of x1 and x2.

This seems to trip panel.mathdensity(), but only when printing to pdf, and I
can't find a way to avoid it. Consider

  
stopifnot(require(lattice))
stopifnot(require(grid))

pdf(testfile.pdf)
Q-data.frame(x1=sample(c(A,B),10,replace=TRUE),
  x2=c(C, rep(D,9)), y=rnorm(10))
print(histogram(~ y | x1+x2, data=Q,
panel = function(x, ...) {
  if (length(x)  0) {
panel.histogram(x, ...)
panel.mathdensity(dmath = dnorm, col = black,
  args = list(mean=mean(x, na.rm=TRUE), 
  sd=sd(x, na.rm=TRUE)))
  }
}))
dev.off()


where the resulting pdf file is broken if and only if the panel.mathdensity
call is present.  Without it, it works.  To the screen, it works with and
without -- but copying to pdf again  breaks the pdf file if
panel.mathdensity is used.

It is possible that I am overlooking something simple -- or is it a genuine
bug?

Platform is win2k, R version is 1.9.1.

Thanks for any pointers,  Dirk

-- 
Those are my principles, and if you don't like them... well, I have others.
-- Groucho Marx

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


Re: [R] binning a vector

2004-07-26 Thread Wolski
?tapply

*** REPLY SEPARATOR  ***

On 7/26/2004 at 5:11 PM [EMAIL PROTECTED] wrote:

Hello,

I was wondering wether there's a function in R that takes two vectors
(of same length) as input and computes mean values for bins (intervals)
or even a sliding window over these vectros.

I've several x/y data set (input/response) that I'd like plot together.
Say the x-data for one data set goes from -5 to 14 with 12,000 values,
then I'd like to bin the x-vector in steps of +1 and calculate and plot
the mean of the x-values and the y-values within each bin.

I was browsing the R-docs but couldn't find anything appropiate.

 thanks for hints + kind regads,

 Arne

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


Re: [R] lattice / pdf bug ?

2004-07-26 Thread Deepayan Sarkar
On Monday 26 July 2004 18:17, Dirk Eddelbuettel wrote:
 I've been scrathing my head over this one.  Suppose I have a
 data.frame which maps to a 'n x k' lattice, and that one of those
 cells is empty.

 An artificial example is generated by

 Q-data.frame(x1=sample(c(A,B),10,replace=TRUE),
   x2=c(C, rep(D,9)), y=rnorm(10))

 where by having only one obs. for the first level of the second
 factor x2, we ensure that there won't be full combinations of x1 and
 x2.

The empty cell is not the issue, rather it's the fact that the panel 
that gets the first observation (x2 = C) has only that one single 
observation. So for that panel, sd(x, na.rm = TRUE) = NA, hence 

dnorm(mesh points, mean = whatever, sd = NA) 

eventually produces a bunch of NA's, which grid.lines tries to draw. 
grid.lines has known issues with NA's, and I would guess that's what 
causes the broken pdf.

The good news is that there doesn't seem to be any problems in r-devel 
(possibly because grid handles NA's better now).

The natural workaround for your code would be to skip the 
panel.mathdensity call unless length(x)  1.

Deepayan


 This seems to trip panel.mathdensity(), but only when printing to
 pdf, and I can't find a way to avoid it. Consider


 stopifnot(require(lattice))
 stopifnot(require(grid))

 pdf(testfile.pdf)
 Q-data.frame(x1=sample(c(A,B),10,replace=TRUE),
   x2=c(C, rep(D,9)), y=rnorm(10))
 print(histogram(~ y | x1+x2, data=Q,
 panel = function(x, ...) {
   if (length(x)  0) {
   panel.histogram(x, ...)
 panel.mathdensity(dmath = dnorm, col = black,
   args = list(mean=mean(x,
 na.rm=TRUE), sd=sd(x, na.rm=TRUE))) }
 }))
 dev.off()


 where the resulting pdf file is broken if and only if the
 panel.mathdensity call is present.  Without it, it works.  To the
 screen, it works with and without -- but copying to pdf again  breaks
 the pdf file if
 panel.mathdensity is used.

 It is possible that I am overlooking something simple -- or is it a
 genuine bug?

 Platform is win2k, R version is 1.9.1.

 Thanks for any pointers,  Dirk

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


Re: [R] qcc package syndromic surveillance (multivar CUSUM?)

2004-07-26 Thread Spencer Graves
 What do you think is most plausible:  an abrupt jump or a gradual 
drift?  To detect an abrupt jump from a null hypothesis H0 to an 
alternative H1, the tool of choice seems to be a cumulative sum (CUSUM) 
of log(likelihood ratio).  If H0 and H1 are normal distributions with 
equal variances, this general rule specializes to a one-sided cumulative 
sum of (y[t]-mu.bar), where mu.bar is the average of the means under H0 
and H1. 

 However, to detect a gradual drift modeled as a random walk, the 
theory says that the best tool is something like an exponentially 
weighted moving average (EWMA). 

 For monitor design, I like to write the following: 

 joint = observation * prior = posterior * predictive
 f(y  mu) = f(y | mu)*f(mu) = f(mu | y)*f(y). 

When each observation arrives, I test to see if it is consistent with 
the predictive distribution f(y).  If it is not consistent, I report a 
potential problem.  If it is consistent, I incorporate it into the EWMA 
[or CUSUM], as described by the posterior f(mu | y).  For more 
information on this, see Bayes' Rule of Information and other 
foundations of monitoring reports downloadable from 
www.prodsyse.com.  This kind if use of the predictive distribution is 
discussed in the West and Harrison (1999) book cited in the Bayes' 
Rule paper, and a Poisson EWMA is derived on p. 5. 

 What you use, of course, depends on the events you hope to 
capture.  For your applications, I might consider running separate 
monitors on each condition-hospital pair plus monitors on the totals for 
each hospital and for each condition, plus one for overall.  I might use 
the qcc package to calibrate my thresholds, but do the daily 
computations in some data base system. 

 Selecting thresholds is not easy, in part because the assumptions 
you make for monitor design will never hold exactly in practice.  The 
result of this is that any thresholds you compute based purely on theory 
will be wrong.  However, if you tune your thresholds based on the years 
of historical data you have, you should be on safer ground.  This theory 
should get you close to an optimal arrangement.  I think I would use 
quite loose thresholds for the hospital-condition (interaction) 
monitors, thighter thresholds for the condition and hospital totals, and 
the tightest threshold for the overall.  Monitors on specific conditions 
should be sensitive to epidemics or to an effective biological warfare 
terrorist attack;  if this is your concern, a CUSUM might be best.  
Monitors on specific hospitals should be sensitive to changes in the 
competence of local staff (suggesting a preference for an EWMA) or to a 
sudden local outbreak of something (suggesting a CUSUM).  Monitors on 
condition-hospital pairs might be sensitive to local changes in 
preferred diagnoses.  I would run Cusums or EWMAs but not both:  Either 
will catch conditions most quickly caught by the other, with possible a 
little longer delay. 

 hope this helps.  spencer graves
[EMAIL PROTECTED] wrote:
Dear R Community:
I am working on a public health early warning system, and 
I see that the qcc package allows for CUSUM and other statistical quality tests
but I am not sure if my project is a good match for qcc functions as written.
Any advice you may have is very much appreciated.

I have four years worth of daily counts of emergency room admissions for 
different conditions (e.g. respiratory, neurologic, etc) from several local 
hospitals.  the data looks like this...

DAY 1
 Respiratory Neuro   ...
Hospital A:   1012
.  . .
.  . .
Hospital F:714
DAY 2 Respiratory Neuro   ...
Hospital A:   1012
.  . .
.  . .
Hospital F:714...
etc.,
and my goal is to do a kind of multivariate quality control test (without 
fitting a GLM), that would run each day after the data is updated and be able 
to answer the question: 
Has there been a significant variation in the central tendency of the data?

An analogous problem would be detecting the early signs of a shift in global 
trading patterns by examining stock market indexes in different countries 
around the world, updating and testing the data each business day. 

Thank you, 

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

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


[R] dumpClass

2004-07-26 Thread Spencer Graves
 What do people do in R to get something comparable to the 
functionality of dumpClass described by Chambers (1998) Programming 
with Data (Springer)? 

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


[R] Reading SPSS file

2004-07-26 Thread Arin Basu
Hi Karl:

a possible solution:

require(foreign)
mydata - read.spss(somedata.sav, use.value.labels = TRUE, to.data.frame = TRUE)
-
for more information, try

library(foreign)
?read.spss

HTH,
Arin


Message: 21
Date: Mon, 26 Jul 2004 10:36:33 +0200 (CEST)
From: Karl Knoblick [EMAIL PROTECTED]
Subject: [R] Read SPSS data (*.sav) in R 1.8.0 (ok) and R1.9.1(error)
To: [EMAIL PROTECTED]
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=iso-8859-1

Hallo!

snipped

Does anybody know a possibilty to read a SPSS file
under R1.9.1?

Thanks!
Karl
  



Arindam Basu MD MPH DBI
Assistant Director
Fogarty International Program on Environmental Health in India
IPGMER
244 AJC Bose Road, Kolkata 700027
India
[[alternative HTML version deleted]]

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


[R] re: help with lattice plot

2004-07-26 Thread Eve . McDonald-Madden
Dear List,

I have been using R to create an xyplot using the panel function within
lattice libraries. This plot is based on the data supplied in R named
'Oats'. The graph represents oat yield by nitro level with an overlay of
each variety of oats for each nitro level.

I have three questions regarding this graph:
1) I cannot seem to specify the type of symbol used by the plot, even
though it is included in the code below, it will change when the code is
changed?
2) I have managed to include a legend on the graph using the key function;
however the labels of the legend do not seem to correspond to the right
coloured symbol as used in the plot itself for Variety. How can I get the
symbols and text in the legend to match that used in the graph itself?
3) Also, I am interested to know how I can manipulate the order in which
each graph (in this instance Nitro level) appears? For example, at the
moment the graphs do not appear in numerical order (based on the levels of
the factor nitro) can I reorder them so that they appear in the order   I,
II,  III,
 IV,  V,   VI
?

The code I have used is included below:

##Data
library(nlme)
data(Oats)

##Factors
Oats$Block-factor(Oats$Block)
Oats$Variety-factor(Oats$Variety)
Oats$nitro-factor(Oats$nitro)
attach(oats)

##Plot
library(lattice)
lset(col.whitebg())
xyplot(yield~nitro|Block, data=Oats,xlab=Nitrogen Level,ylab=Yield of
oats,subscripts=T, groups=Oats$Variety, as.table=T,
panel=function(x,y,groups,subscripts){
panel.superpose(x=x, y=y, groups=Oats$Variety,
subscripts=subscripts,pch=18)
panel.superpose(x=x, y=y, groups=Oats$Variety, subscripts=subscripts, type
=r)
}
,key = list(points = Rows(trellis.par.get(superpose.line),c(1:2,3)),text
= list(lab = as.character(unique(Oats$Variety))),pch=18)
)


I would greatly appreciate anyone's time in assisting me with this request.

I look forward to your reply

Regards

Eve

Eve McDonald-Madden
Fauna Ecology
Arthur Rylah Institute for Environmental Research
Heidelberg, Victoria.Australia
Email:  [EMAIL PROTECTED]

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


Re: [R] re: help with lattice plot

2004-07-26 Thread Deepayan Sarkar
On Monday 26 July 2004 21:51, [EMAIL PROTECTED] wrote:
 Dear List,

 I have been using R to create an xyplot using the panel function
 within lattice libraries. This plot is based on the data supplied in
 R named 'Oats'. The graph represents oat yield by nitro level with an
 overlay of each variety of oats for each nitro level.

 I have three questions regarding this graph:
 1) I cannot seem to specify the type of symbol used by the plot, even
 though it is included in the code below, it will change when the code
 is changed?

You are doing several things wrong. There's more than one way to fix it. 
For example, the approach you have taken may be modified to give (after 
the lset(col.whitebg()) call in your example):


lset(list(superpose.symbol = list(pch = 18)))
xyplot(yield ~ nitro | Block,
   data = Oats,
   xlab = Nitrogen Level,
   ylab = Yield of oats,
   groups = Variety,
   as.table = T,
   panel = function(x, y, groups, subscripts) {
   panel.superpose(x = x, y = y, groups = groups,
   subscripts = subscripts)
   panel.superpose(x = x, y = y, groups = groups,
   subscripts = subscripts,
   type =r)
   },
   key =
   list(points = Rows(trellis.par.get(superpose.symbol), 1:3 ),
text = list(lab = levels(Oats$Variety

A line by line comparison with your code should indicate the 
differences.

But since you are using some lattice-specific features (not available in 
S-PLUS) anyway, I would take it a bit further and simplify this to 
(again, after the lset(col.whitebg()) call in your example):

xyplot(yield ~ nitro | Block,
   data = Oats,
   xlab = Nitrogen Level,
   ylab = Yield of oats,
   groups = Variety,
   as.table = TRUE, 
   type = c(p, r),
   par.settings = list(superpose.symbol = list(pch = 18)),
   auto.key = TRUE)


 2) I have managed to include a legend on the graph using the key
 function; however the labels of the legend do not seem to correspond
 to the right coloured symbol as used in the plot itself for Variety.
 How can I get the symbols and text in the legend to match that used
 in the graph itself? 

Wherever there's the need for 'ordering' a factor, the order is 
determined by its levels - given by the levels() function. In this 
case, the order would be given by levels(Oats$Variety), and not 
as.character(unique(Oats$Variety)) which you were using for some 
reason. This fact is relevant to your next question as well.

 3) Also, I am interested to know how I can 
 manipulate the order in which each graph (in this instance Nitro
 level) appears? For example, at the moment the graphs do not appear
 in numerical order (based on the levels of the factor nitro) can I
 reorder them so that they appear in the order   I, II,  III,
  IV,  V, 
  VI ?

Surely you mean Block and not nitro?

It behaves in this way because that's the order given by 
levels(Oats$Block) (the reason should be apparent after 
reading ?groupedData from nlme). You can choose your own order when 
using the factor function (your current use doesn't do anything, by the 
way):

Oats$Block -
factor(Oats$Block,
   levels = c(I,  II,   III, IV,  V,  VI))


Hope that helps,

Deepayan

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