Re: [R] can't understand R

2004-09-21 Thread Uwe Ligges
Erin L. Leisz wrote:
hi.  i really need help using this program.  computer language is a 
foreign language to me, and thus, i cannot make heads nor tails of the 
user manuals from the website.  i need to locate step-by-step examples 
of simple problems such as graph f(x)+g(x) and f(g(x)) for the domain 
0x2 and graph 2H(x), H(x)+1, H(x+1)  i do know how to define the 
functions, but that's it.  is there any help you could provide me?  i 
would appreciate some help asap.  thank you very much
erin leisz
If the manual An Introduction to R is not sufficient for you, what 
about reading a book, e.g. Peter Dalgaard's Introductory Statistics 
with R, Springer? Here you learn R along some basic statistical analyses.

Uwe Ligges

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


[R] bubble plots

2004-09-21 Thread Jacques VESLOT
Dear all,

I'm used to draw bubble plots (gstat) to get a first view of my spatial
marked data, but I can't find a way to label legend with marks after having
replaced them by a numeric scale.

I have a data frame with numeric coords and factors:

 names(data)
[1] x y bloc  sub   inoc  etat
etc...

 levels(data$etat)
[1] F   Fi  NF  NFi


I do:

 levels(data$etat) - c(0, 2, -2, 1, -1)

 data$etat - as.numeric(as.vector(data$etat))

 C1 - subset(data, sub==C  bloc==1, select=c(x, y, etat))

 x11()
 lset(theme = col.whitebg())
 bubble(C1, xcol = 1, ycol = 2, zcol = 3,
xlab = , ylab = , main = Bloc 1  -  Substrat C,
key.entries = min(C1[, 3]):max(C1[, 3]), maxsize=3)

I then obtain -2, -1, O, etc. as legend labels and cannot find
argument making it possible to label my legend with initial marks: F1,
NFi, etc.

Besides, I also tried with image() but I faced the following error message,
even though I ordered x- and y-coords:

Error in image.default(C1$x, C1$y, C1$etat) :
   increasing x and y values expected

I'd really appreciate if someone could give me either an option to label
adequately bubble plots, or even to make me know if there is another - maybe
better - way to plot spatial marked data.


Jacques VESLOT
CIRAD Réunion

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


Re: [R] can't understand R

2004-09-21 Thread Thomas Schönhoff
Hello,
Uwe Ligges schrieb:
Erin L. Leisz wrote:

If the manual An Introduction to R is not sufficient for you, what 
about reading a book, e.g. Peter Dalgaard's Introductory Statistics 
with R, Springer? Here you learn R along some basic statistical analyses.
BTW, can anybody recommend a book on S/R and data mining?
Thomas
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] unable to load shared library /home/hpc1367/runs/taper/taper.so

2004-09-21 Thread Martin Maechler
 hpc1367 == hpc1367  [EMAIL PROTECTED]
 on Mon, 20 Sep 2004 18:18:58 -0400 writes:

Why do you put the full filename in the e-mail subject?
(We'd rather want to know your operating system, some
 kind of unix, probably Linux, seen from below)

hpc1367 I am trying to load a .so file and get the
hpc1367 following error message:
 dyn.load(taper.so,local=F)
hpc1367 Error in dyn.load(x, as.logical(local),
hpc1367 as.logical(now)) : unable to load shared library
hpc1367 /home/hpc1367/runs/taper/taper.so: ld.so.1:
hpc1367 /usr/local/lib/R/bin/R.bin: fatal: relocation
hpc1367 error: file /home/hpc1367/runs/taper/taper.so:
hpc1367 symbol f90_init: referenced symbol not found
 
this is the crucial part !

hpc1367 also tried with default local=T and got same error.

of course, since your fortran90 code needsf90_init()
and that is evidently not linked into your taper.so
but is provided by your Fortran90 
hpc1367 my makefile (used to produce the .so) is included below


hpc1367 F90S = taper.f90
hpc1367 OBJS = taper.o
hpc1367 LIBS = -lsocket -lnsl -lintl
hpc1367 OPT = -fast
hpc1367 MODS = -M/opt/NAG/fnsol04dbl/nag_mod_dir
hpc1367 NAG = /opt/NAG/fnsol04dbl/libnagfl90.a

hpc1367 STATNAG = /opt/NAG/flsol20dal/libnag.a

hpc1367 taper.o : taper.f90
hpc1367 f95 -c -dalign  $(OPT) $(MODS) taper.f90

hpc1367 taper.so: taper.f90
hpc1367 f95 -o taper.so -G -dalign $(OPT) $(MODS) taper.f90

hpc1367 taper.x : taper.o
hpc1367 f95 -o taper.x -dalign $(OPT) $(MODS) $(LIBS) taper.o $(OBJS)
hpc1367 $(NAG)

You must make sure that the system library which defines the
f90_init() symbol is specified at link time, i.e., when taper.so
is built. 
So I guess you need at least the $(LIBS) also in that line,
probably also $(NAG).

But we don't have your non-free NAG compilers and libraries and
it's hard to find out from here.  Use 'nm' and 'ldd' but
probably rather ask someone at your institution who knows more
about compilation and linking.

hpc1367 please, help
hpc1367 thank you very much

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


Re: [R] installing on alpha

2004-09-21 Thread Martin Maechler
 Alexa == Alexa Sorant [EMAIL PROTECTED]
 on Mon, 20 Sep 2004 17:35:43 -0400 writes:

Alexa I am trying to install R-1.9.1 on an alpha (Tru64 unix) platform.  I had no 
Alexa problem previously installing R-1.4.0, but cannot get the new installation 
Alexa to work.  First I ran configure specifying an alternate installation 
Alexa directory:
Alexa ./configure --prefix=/appl/R-1.9.1

We even recommend using an alternate *build* directory:

 mkdir Rbuild
 cdRbuild
 ../Rsrc/configure 

and indeed, since R 2.0.0 is beta now (which means testing and
almost stable, not unstable!),
we'd appreciate (and feel more willing to support you) if you'd
tried to install R-2.0.0 directly.

Alexa then ran make (note that this is NOT gmake, which
Alexa may make the difference).  The error message I get is:
Alexa Make:  cannot open /share/make/vars.mk.  Stop.

Alexa The file share/make/vars.mk is there and readable,
Alexa but share is a subdirectory of the main installation
Alexa directory.  Upon examining Makefile and associated
Alexa files, I found a statement in Makeconf include
Alexa $(top_srcdir)/share/make/vars.mk which I suspected
Alexa was the problem -- perhaps the definition of
Alexa top_srcdir not is carrying over from the Makefile
Alexa that references Makeconf.

yes, that seems clear.  If your 'make' is not supporting such
'include' statements in Makefiles,  you definitely must use GNU
make (seemingly called 'gmake' on alpha) !

Did you look at the INSTALL file, or even consult the 
R Administration and Installation manual
(available from R-projec.org as well) ?

Alexa (One reason I suspect this statement is that it is new
Alexa since the version of R that I installed easily, as
Alexa well as the early reference to this particular file.)

Alexa I have tried a bunch of ways of modifying this
Alexa statement, including an explicit path in this
Alexa statement.  I think that did work, but a similar
Alexa problem then occurred at a later point that I haven't
Alexa yet located.

Alexa Has anyone gotten this installation to work on this platform?

Alexa Alexa J. M. Sorant
Alexa NIH/NHGRI
Alexa 333 Cassell Drive Suite 2000
Alexa Baltimore, MD 21224

Alexa [EMAIL PROTECTED]

Alexa (410) 550-7512 voice
Alexa (410) 550-7513 fax

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


Re: [R] plot.Map with pattern instead of colors

2004-09-21 Thread Arne Henningsen
Dear Roger,

thank you for your valuable hints regarding plot.polylist, Map2poly and 
RColorBrewer( , Greys ). Adding pattern to some shapes with 
plot( Map2poly( x ), density = myDensities, add = TRUE ) works great!

Best wishes,
Arne

On Monday 20 September 2004 14:20, Roger Bivand wrote:
 On Mon, 20 Sep 2004, Arne Henningsen wrote:
  Hi,
 
  I am plotting shapefiles with plot.Map (package maptools). So far I use
  different colors for the shapes depending on the a value that belongs to
  the shape. Now, I need to produce maps only in black, gray and white for
  publication. Is it possible to fill shapes with pattern (e.g. hatched)
  instead of colors?

 Not in plot.Map(). This is supported if you convert the shapefile polygons
 to a polylist object (Map2poly()), then use plot.polylist() - but this may
 not be your choice. Within plot.Map, I would suggest using the
 RColorBrewer package and the sequential Greys palette, which
 differentiates five grey colours very well for most media.

 If you run this after example(plot.Map), it should illustrate a solution:

 library(RColorBrewer)
 pal - brewer.pal(5, Greys)
 fgs - pal[findInterval(x$att.data$BIR74, res$breaks, all.inside=TRUE)]
 plot(x, fg=fgs)

 for the default quantile breaks.

  Details of a simplified example:
  I want to show the percentage change of a variable in a map:
  e.g. following levels
  a) +10
  b) +5% to +10%
  c) -5% to +5%
  d) -10% to -5%
  e) -10%
 
  Now I have following colors
  a) red
  b) orange
  c) white
  d) greenyellow
  e) green3
 
  Printing this on a monochrome printer is - of course - stupid, because
  levels a) and e) as well as b) and d) have approximately the same
  grayscale. I could fill a) = black and e) = white, and everything
  inbetween with an appropriate grayscale, but I prefer to have areas with
  no change to appear white rather than medium gray. Therefore, I thought
  of doing following: a) black
  b) gray
  c) white
  d) hatched with thin lines
  e) hatched with thick lines (or double-hatched)
 
  Any hints and ideas are welcome!
  (BTW: I use R 1.9.1 on SuSE Linux 9.0)
 
  Thanks,
  Arne

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

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


Re: [R] S/R and data mining (was can't understand R)

2004-09-21 Thread Dimitris Rizopoulos
Hi Thomas,
@Book{hastie.et.al:01,
 author= {T. Hastie and R. Tibshirani and J. Friedman},
 address   = {New York},
 publisher = {Springer-Verlag},
 title = {The Elements of Statistical Learning: Data Mining, 
Inference and Prediction},
 year  = {2001}
}

might be helpful.
Best,
Dimitris

Dimitris Rizopoulos
Ph.D. 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: Thomas Schönhoff [EMAIL PROTECTED]
To: R User-Liste [EMAIL PROTECTED]
Sent: Tuesday, September 21, 2004 9:34 AM
Subject: Re: [R] can't understand R


Hello,
Uwe Ligges schrieb:
Erin L. Leisz wrote:

If the manual An Introduction to R is not sufficient for you, what 
about reading a book, e.g. Peter Dalgaard's Introductory 
Statistics with R, Springer? Here you learn R along some basic 
statistical analyses.
BTW, can anybody recommend a book on S/R and data mining?
Thomas
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

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


Re: [R] compilation failed for package

2004-09-21 Thread Roger Bivand
On Mon, 20 Sep 2004 [EMAIL PROTECTED] wrote:

 Hello, I am new to R on Linux (and to LINUX), running a 1.9.1 on a Linux
 MDK10.0. When updating or installing different packages, I get messages
 like this (under), the package doesn't install. Can anyone help me? I
 know this is all to little information, but I don't know were to start.
 I think there is something wrong in how or were the C++ or fortran
 compilator is installed?? Thanks, Geir S.

After some offline exchanges, the problem has been resolved. This Mandrake
10.0 installation had R installed from binary, had gcc 3.4.1, but (most
likely) binutils 2.14 that did not recognise the new --as-needed flag. For
this reason, update.packages() - this was the survival case mentioned in
the post - and install.packages() failed on compilation. The fact that
such a build system is broken is demonstrated by:

$ cat  EOF  hello.c
#include stdio.h
int main(void)
{
  printf(Hello World!\n);
  exit(0);
}
EOF
$ gcc -o hello hello.c
/usr/bin/ld: unrecognized option '--as-needed'
/usr/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status

Resolution by updating binutils or installing older gcc-* RPMs instead of 
3.4.1.

 
 
 gcc -shared -L/usr/local/lib -o survival.so agexact.o agfit2.o agfit3.o agfit5.o 
 agfit_null.o agmart2.o agmart.o agscore.o agsurv1.o agsurv2.o agsurv3.o char_date.o 
 chinv2.o chinv3.o cholesky2.o cholesky3.o chsolve2.o chsolve3.o coxdetail.o 
 coxfit2.o coxfit5.o coxmart.o coxph_wtest.o cox_Rcallback.o coxscho.o coxscore.o 
 dmatrix.o doloop.o pyears1.o pyears2.o pyears3.o pystep.o surv_callback.o 
 survdiff2.o survfit2.o survfit3.o survindex2.o survindex3.o survreg2.o survreg3.o 
 survreg4.o survreg5.o
 /usr/bin/ld: unrecognized option '--as-needed'
 /usr/bin/ld: use the --help option for usage information
 collect2: ld returned 1 exit status
 make: *** [survival.so] Error 1
 ERROR: compilation failed for package 'survival'
 ** Removing '/usr/lib/R/library/survival'
 ** Restoring previous '/usr/lib/R/library/survival'
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: [EMAIL PROTECTED]

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


Re: [R] adding function to a Package

2004-09-21 Thread Uwe Ligges
Stephen Henderson wrote:
As a shortcut I have previously added my own functions to a Package (ipred)
under R-1.8.1,  changing the NAMESPACE file to accomodate this then
reinstalling. This doesn't now seem possible in R-1.9.0 is this correct?-- I
am getting an error saying:
files NAMESPACE, R/ipred have the wrong MD5 checksums
after I try to reinstall (which I can understand). Is there a quick way
round this avoiding having to build my own Package?

Looks like you have added to the binary rather than the soource package.
Please change the source package instaed and re-install.
BTW: It is a better idea to put the stuff in your own package, because 
it will be hard for you to go with each update of ipred, since you have 
to re-apply your patches again and again ...

Uwe Ligges

Thanks
Stephen
**
This email and any files transmitted with it are confidentia...{{dropped}}
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] S/R and data mining (was can't understand R)

2004-09-21 Thread Vito Ricci
Hi Thomas,

see these papers or books (some are available on the
web):

Diego Kuonen, Introduction au data mining avec R :
vers la reconquête du `knowledge discovery in
databases' par les statisticiens. Bulletin of the
Swiss Statistical Society, 40:3-7, 2001.
Consultabile all’indirizzo web:
http://www.statoo.com/en/publications/2001.R.SSS.40/

Diego Kuonen and Reinhard Furrer, Data mining avec R
dans un monde libre. Flash Informatique Spécial Été,
pages 45-50, sep 2001.
Consultabile all’indirizzo web:
http://sawww.epfl.ch/SIC/SA/publications/FI01/fi-sp-1/sp-1-page45.html


Brian D. Ripley, Datamining: Large Databases and
Methods, in Proceedings  of “useR! 2004 - The R User
Conference”, maggio 2004 Consultabile all’indirizzo
web:
http://www.ci.tuwien.ac.at/Conferences/useR-2004/Keynotes/Ripley.pdf

Brian D. Ripley, Using Databases with R, R News,
Gennaio 2001, pagg. 18-20
Consultabile all’indirizzo web:
http://cran.r-project.org/doc/Rnews/Rnews_2001-1.pdf

B. D. Ripley, R. M. Ripley,  Applications of R Clients
and Servers in Proceedings of the Distributed
Statistical Computing 2001 Workshop, 2001, Vienna
University of Technology.
Consultabile all’indirizzo web:
http://www.ci.tuwien.ac.at/Conferences/DSC-2001/Proceedings/Ripley.pdf


Torsten Hothorn, David A. James, Brian D. Ripley,  R/S
Interfaces to Databases  in Proceedings of the
Distributed Statistical Computing 2001 Workshop,
2001,Vienna University of Technology.
Consultabile all’indirizzo web:
http://www.ci.tuwien.ac.at/Conferences/DSC-2001/Proceedings/HothornJamesRipley.pdf

Luís Torgo, Data Mining with R. Learning by case
studies, Maggio 2003
Consultabile all’indirizzo web:
http://www.liacc.up.pt/~ltorgo/DataMiningWithR/

Trevor Hastie , Robert Tibshirani,  Jerome Friedman, 
The Elements of Statistical Learning: Data Mining,
Inference, and Prediction, 2001, Springer-Verlag.
http://www-stat.stanford.edu/~tibs/ElemStatLearn/

I'm find too for some R application for DM.
Best
Vito

Thomas Schönhoff wrote:

Hello,

Uwe Ligges schrieb:
 Erin L. Leisz wrote:

 If the manual An Introduction to R is not
sufficient for you, what 
 about reading a book, e.g. Peter Dalgaard's
Introductory Statistics 
 with R, Springer? Here you learn R along some basic
statistical analyses.

BTW, can anybody recommend a book on S/R and data
mining?


Thomas

=
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



___

http://it.seriea.fantasysports.yahoo.com/

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


Re: [R] can't understand R

2004-09-21 Thread Ramon Diaz-Uriarte
Dear Erin,


On Tuesday 21 September 2004 06:10, Erin L. Leisz wrote:
 hi.  i really need help using this program.  computer language is a foreign
 language to me, and thus, i cannot make heads nor tails of the user manuals
 from the website.  i need to locate step-by-step examples of simple

If you plan to use R more than once, I think you probably want to get used to 
using the manuals (starting with An introduction to R, and maybe some of 
the other intro material available from the R web site).

 problems such as graph f(x)+g(x) and f(g(x)) for the domain 0x2 and
 graph 2H(x), H(x)+1, H(x+1)  i do know how to define the functions, but
 that's it.  is there any help you could provide me?  i would appreciate
 some help asap.  thank you very much

For this particular case of plotting f(x), you can take a look at the function 
curve (do:
?curve
at the R prompt).

Hope this helps.

R.


 erin leisz

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

-- 
Ramón Díaz-Uriarte
Bioinformatics Unit
Centro Nacional de Investigaciones Oncológicas (CNIO)
(Spanish National Cancer Center)
Melchor Fernández Almagro, 3
28029 Madrid (Spain)
Fax: +-34-91-224-6972
Phone: +-34-91-224-6900

http://ligarto.org/rdiaz
PGP KeyID: 0xE89B3462
(http://ligarto.org/rdiaz/0xE89B3462.asc)

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


Re: [R] can't understand R

2004-09-21 Thread Sven C. Koehler
On Tue, Sep 21, 2004 at 09:34:23AM +0200, Thomas Schönhoff wrote:
 BTW, can anybody recommend a book on S/R and data mining?

Try this one, it's not finished but yet available for free:
``Data Mining with R - learning by case studies'' by Luís Torgo;
http://www.liacc.up.pt/~ltorgo/DataMiningWithR/.

Regards

Sven C. Koehler

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


SV: [R] compilation failed for package

2004-09-21 Thread geir.systad
Thanks to Roger Bivand, my problem was solved. binutils 2.14 was updatet to binutils 
2.15, as indicated under.

Geir Helge Systad
Norwegian Institute for Nature Research
Arctic Ecology, Polarmiljsenteret, N-9296 Troms, Norway
Adress aug-04 to feb-05:
Albert Pettersonsvei 13, N-5750 Odda
fax  +47 85 03 82 14
phone+47 53 64 24 94
mobil+47 91 63 70 55
E-mail: [EMAIL PROTECTED] Internett: http://www.ninaniku.no

-Opprinnelig melding-
Fra:Roger Bivand [mailto:[EMAIL PROTECTED]
Sendt:  ti 21.09.2004 10:20
Til:Systad, Geir
Kopi:   [EMAIL PROTECTED]
Emne:   Re: [R] compilation failed for package
On Mon, 20 Sep 2004 [EMAIL PROTECTED] wrote:

 Hello, I am new to R on Linux (and to LINUX), running a 1.9.1 on a Linux
 MDK10.0. When updating or installing different packages, I get messages
 like this (under), the package doesn't install. Can anyone help me? I
 know this is all to little information, but I don't know were to start.
 I think there is something wrong in how or were the C++ or fortran
 compilator is installed?? Thanks, Geir S.

After some offline exchanges, the problem has been resolved. This Mandrake
10.0 installation had R installed from binary, had gcc 3.4.1, but (most
likely) binutils 2.14 that did not recognise the new --as-needed flag. For
this reason, update.packages() - this was the survival case mentioned in
the post - and install.packages() failed on compilation. The fact that
such a build system is broken is demonstrated by:

$ cat  EOF  hello.c
#include stdio.h
int main(void)
{
  printf(Hello World!\n);
  exit(0);
}
EOF
$ gcc -o hello hello.c
/usr/bin/ld: unrecognized option '--as-needed'
/usr/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status

Resolution by updating binutils or installing older gcc-* RPMs instead of 
3.4.1.

 
 
 gcc -shared -L/usr/local/lib -o survival.so agexact.o agfit2.o agfit3.o agfit5.o 
 agfit_null.o agmart2.o agmart.o agscore.o agsurv1.o agsurv2.o agsurv3.o char_date.o 
 chinv2.o chinv3.o cholesky2.o cholesky3.o chsolve2.o chsolve3.o coxdetail.o 
 coxfit2.o coxfit5.o coxmart.o coxph_wtest.o cox_Rcallback.o coxscho.o coxscore.o 
 dmatrix.o doloop.o pyears1.o pyears2.o pyears3.o pystep.o surv_callback.o 
 survdiff2.o survfit2.o survfit3.o survindex2.o survindex3.o survreg2.o survreg3.o 
 survreg4.o survreg5.o
 /usr/bin/ld: unrecognized option '--as-needed'
 /usr/bin/ld: use the --help option for usage information
 collect2: ld returned 1 exit status
 make: *** [survival.so] Error 1
 ERROR: compilation failed for package 'survival'
 ** Removing '/usr/lib/R/library/survival'
 ** Restoring previous '/usr/lib/R/library/survival'
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: [EMAIL PROTECTED]

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


Re: [R] S/R and data mining (was can't understand R)

2004-09-21 Thread Thomas Schönhoff
Thanks Dimitri and Vito,
I'll soon have a look at your recommendations (except the mentioned book 
which might take some time to get hands at!

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


[R] lda predict

2004-09-21 Thread rob foxall (IFR)
Dear R-helpers,

I have a model created by lda, and I would like to use this
model to make predictions for new or old data. The catch is, I want to
do this without using the predict function, i.e. only using
information directly from the foo.lda object to create my posterior
probabilities. In anticipation of likely responses, I will be brushing
up my lda knowledge using the given references when I have time, but am
being hassled for an answer asap!

 

Cheers,

Rob. 


[[alternative HTML version deleted]]

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


Re: [R] GARCH model query

2004-09-21 Thread Adrian Trapletti
Hello,
I am trying to find an easy way to estimate  the following:
y = Function(x) + lag(x,1) + garch_error_component

E.g. estimate the mean component first and then use garch from tseries 
on the residuals from step 1.

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


[R] lme RE variance computation

2004-09-21 Thread Steve Roberts
As I understand it lme (in R v1.9.x) estimates random effect variances 
on a log scale, constraining them to be positive. Whilst this seems 
sensible, it does lead to apparently biased estimates if the variance is 
actually  zero - which makes our simulation results look strange. Whilst 
we need to think a bit deeper about it - I still haven't got my head 
around what a negative variance could mean - does anyone know a 
way to take away the contraint and allowing zero or negative 
variances?

Steve.  Dr Steve Roberts 
  [EMAIL PROTECTED]

Senior Lecturer in Medical Statistics,
CMMCH NHS Trust and University of Manchester Biostatistics Group,
0161 275 5192 / 0161 276 5785

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


Re: [R] lme RE variance computation

2004-09-21 Thread Dimitris Rizopoulos
Hi Steve,
Estimation problems for the variance components in linear mixed models 
are usually occur for two reasons:

1. Due to model misspecification, i.e., using years instead of decades 
may show no variability in the slopes

2. Because the data do not support the assumptions of the linear mixed 
model (i.e., positive definite covariance matrix for the 
random-effects = increasing variance with time).

These may cause zero or even negative variance components. For more 
info you could take a look at Verbeke and Molenberghs (2000, Section 
5.6) and Searle, Casella and McCullogh (1992, Section 3.5).

I don't know the exact formulation you are using, but maybe you could 
consider an analogue of you model using gls, i.e.,

lme(..., random=~1|id)
gls(..., corr=corCompSymm(form=~1|id))
The references mentioned above are:
@Book{verbeke.molenberghs:00,
 author= {G. Verbeke and G. Molenberghs},
 title = {Linear Mixed Models for Longitudinal Data},
 year  = {2000},
 address   = {New York},
 publisher = {Springer-Verlag}
}
@Book{searle.et.al:92,
 author= {S. Searle and G. Cassela and C. McCulloch},
 title = {Variance Components},
 year  = {1992},
 address   = {New York},
 publisher = {Wiley}
}
I hope it helps.
Best,
Dimitris

Dimitris Rizopoulos
Ph.D. 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: Steve Roberts [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 21, 2004 1:38 PM
Subject: [R] lme RE variance computation


As I understand it lme (in R v1.9.x) estimates random effect 
variances
on a log scale, constraining them to be positive. Whilst this seems
sensible, it does lead to apparently biased estimates if the 
variance is
actually  zero - which makes our simulation results look strange. 
Whilst
we need to think a bit deeper about it - I still haven't got my head
around what a negative variance could mean - does anyone know a
way to take away the contraint and allowing zero or negative
variances?

Steve.  Dr Steve Roberts
 [EMAIL PROTECTED]
Senior Lecturer in Medical Statistics,
CMMCH NHS Trust and University of Manchester Biostatistics Group,
0161 275 5192 / 0161 276 5785
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

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


[R] How to plot residuals vs. fitted of trgls object (spatial::surf.gls)

2004-09-21 Thread Wolski
Hi!

Would like to to make a plot of residuals vs. fitted and Y vs. predicted values   from 
an object of class trgls as returned by spatial::surf.gls directly.
(without calling spatial::predict.trgls)
Is it possible? on which list components should I look at?

/E

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


[R] How to call a R function from C or C++ ?

2004-09-21 Thread Bruno Nogent
Have you some simple examples ?
[[alternative HTML version deleted]]

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


Re: [R] How to call a R function from C or C++ ?

2004-09-21 Thread Uwe Ligges
Bruno Nogent wrote:
Have you some simple examples ?
See the manual Writing R Extensions.
Uwe Ligges
[[alternative HTML version deleted]]
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Bootstrap ICC estimate with nested data

2004-09-21 Thread Bliese, Paul D MAJ USAMH
I would appreciate some thoughts on using the bootstrap functions in the
library bootstrap to estimate confidence intervals of ICC values
calculated in lme.

In lme, the ICC is calculated as tau/(tau+sigma-squared).  So, for instance
the ICC in the following example is 0.116:

 tmod-lme(CINISMO~1,random=~1|IDGRUP,data=TDAT)
 VarCorr(tmod)
IDGRUP = pdLogChol(1) 
Variance  StdDev  
(Intercept) 0.1829931 0.42
Residual1.3907732 1.179310
 0.18299/(0.18299+1.39077)
[1] 0.1162757

Using the bootstrap library, I can set up theta to do the ICC as follows:

theta-function(x,DATA){tmod-lme(CINISMO~1,random=~1|IDGRUP,data=DATA[x,])
OUT-as.numeric(VarCorr(tmod)[[1]])/(as.numeric(VarCorr(tmod)[[1]])+as.numer
ic(VarCorr(tmod)[[2]]))
return(OUT)}

Finally, I can run the bootstrap-t confidence limit function (or other
functions) as follows:

 bootout-boott(1:nrow(TDAT),100,theta,data=TDAT)

This seems to work, but the estimates also seem strange.  For intance, the
observed ICC value is larger than the 95% confidence intervals provided by
the bootstrap.  It occurs to me that the results might be strange because
the sampling with replacement is being done without regard to group
membership.  That is, I might select individual 1 from group 1 10 times
(even though in the sample the group only has 5 members), and I might not
select any individuals from group 2.

My fundamental question is:  What are people's thoughts about using
bootstaping in nested data?  Does one have to sample with replacement taking
into consideration the group structure in the data?  If so, any suggestions
on how to do this?


Paul Bliese
US Army Medical Research Unit - Europe

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


[R] bubble plots

2004-09-21 Thread Edzer Pebesma
Jacques, please try the following:
 z=factor(c('a', 'b','c'))
 z
[1] a b c
Levels: a b c
 x = c(1,2,3)
 y = c(3,2,1)
 xyplot(y~x,groups=z,auto.key=T,asp=diff(range(y))/diff(range(x)))
the asp argument takes care of one unit in x being equal to one unit in y.
If you add e.g. pch=z to vary symbols, auto.key will have to be replaced
by the more complex key argument, see ?xyplot
Color and symbol type are better to distinguish factor variables than
size is, so I'd recommend using xyplot rather than bubble (which uses
xyplot to plot bubbles)
--
Edzer
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Bootstrap ICC estimate with nested data

2004-09-21 Thread Andrew Robinson
Paul,

I think that you should account for the group structure.

My reading of Davison and Hinkley Bootstrap Methods and their
Application (1997, p. 100) suggests that for balanced data structures
with more than, say, 10 clusters, one should apply the bootstrap to
the clusters, but not within the clusters.  They provide some further
notes that you might find useful.

I hope that this helps.

Andrew

On Tue, Sep 21, 2004 at 03:41:29PM +0200, Bliese, Paul D MAJ USAMH wrote:
 I would appreciate some thoughts on using the bootstrap functions in the
 library bootstrap to estimate confidence intervals of ICC values
 calculated in lme.
 
 In lme, the ICC is calculated as tau/(tau+sigma-squared).  So, for instance
 the ICC in the following example is 0.116:
 
  tmod-lme(CINISMO~1,random=~1|IDGRUP,data=TDAT)
  VarCorr(tmod)
 IDGRUP = pdLogChol(1) 
 Variance  StdDev  
 (Intercept) 0.1829931 0.42
 Residual1.3907732 1.179310
  0.18299/(0.18299+1.39077)
 [1] 0.1162757
 
 Using the bootstrap library, I can set up theta to do the ICC as follows:
 
 theta-function(x,DATA){tmod-lme(CINISMO~1,random=~1|IDGRUP,data=DATA[x,])
 OUT-as.numeric(VarCorr(tmod)[[1]])/(as.numeric(VarCorr(tmod)[[1]])+as.numer
 ic(VarCorr(tmod)[[2]]))
 return(OUT)}
 
 Finally, I can run the bootstrap-t confidence limit function (or other
 functions) as follows:
 
  bootout-boott(1:nrow(TDAT),100,theta,data=TDAT)
 
 This seems to work, but the estimates also seem strange.  For intance, the
 observed ICC value is larger than the 95% confidence intervals provided by
 the bootstrap.  It occurs to me that the results might be strange because
 the sampling with replacement is being done without regard to group
 membership.  That is, I might select individual 1 from group 1 10 times
 (even though in the sample the group only has 5 members), and I might not
 select any individuals from group 2.
 
 My fundamental question is:  What are people's thoughts about using
 bootstaping in nested data?  Does one have to sample with replacement taking
 into consideration the group structure in the data?  If so, any suggestions
 on how to do this?
 
 
 Paul Bliese
 US Army Medical Research Unit - Europe
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
Andrew Robinson  Ph: 208 885 7115
Department of Forest Resources   Fa: 208 885 6226
University of Idaho  E : [EMAIL PROTECTED]
PO Box 441133W : http://www.uidaho.edu/~andrewr
Moscow ID 83843  Or: http://www.biometrics.uidaho.edu
No statement above necessarily represents my employer's opinion.

- End forwarded message -

-- 
Andrew Robinson  Ph: 208 885 7115
Department of Forest Resources   Fa: 208 885 6226
University of Idaho  E : [EMAIL PROTECTED]
PO Box 441133W : http://www.uidaho.edu/~andrewr
Moscow ID 83843  Or: http://www.biometrics.uidaho.edu
No statement above necessarily represents my employer's opinion.

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


[R] how to do jaccknife validation with R

2004-09-21 Thread rongguiwong
i can only find jackknife validation after boot.
but this may be not the things i want.

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


[R] R 1.9.1 Fails to Start on WinXP SP2

2004-09-21 Thread Scott Higginbotham
I have two computers both of which are running Windows XP SP2. R 1.9.1
runs just fine on one but not the other. Both installations of R came
from the same installation package. When I click on the desktop icon an
hourglass shows up then disappears. Similarly, if I start RGUI the
process shows up in task-manager then abruptly disappears.
Interestingly, I can access R in Excel via the D(COM) Server on both
computers.

Any ideas?

Thanks,

Scott

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


Re: [R] bubble plots

2004-09-21 Thread Deepayan Sarkar
On Tuesday 21 September 2004 08:41, Edzer Pebesma wrote:
 Jacques, please try the following:
   z=factor(c('a', 'b','c'))
   z

 [1] a b c
 Levels: a b c

   x = c(1,2,3)
   y = c(3,2,1)
   xyplot(y~x,groups=z,auto.key=T,asp=diff(range(y))/diff(range(x)))

 the asp argument takes care of one unit in x being equal to one unit
 in y. 

FWIW, In R 2.0.0 (currently beta), you can also do this with 
aspect=iso.

 If you add e.g. pch=z to vary symbols, auto.key will have to be 
 replaced by the more complex key argument, see ?xyplot

An alternative would be to change the settings (which is the only way 
the panel function and auto.key can share information). Temporary 
changes in settings can be attached to a trellis object as follows:

xyplot(y~x,groups=z,auto.key=T,asp=diff(range(y))/diff(range(x)),
   par.settings = 
   list(superpose.symbol = list(cex = 2, pch = levels(z

Deepayan

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


[R] DSE: covariance of white noise

2004-09-21 Thread Hagen Schmöller
Hi R-Community,

I estimated a VARMA model with bft in dse1 without input: A(L)yt = B(L)et

I got the auto-regressive polynomial array A and the moving-average
polynomial array B, but how can I access the covariances of the white noise
et (disturbance vector), e.g. for simulation?

Much thanks in advance,

Hagen Schmoeller
--
Dipl.-Ing. Hagen K. Schmöller
Leiter Forschungsgruppe Stromerzeugung und -handel
Institut für Elektrische Anlagen und Energiewirtschaft, RWTH Aachen
Schinkelstraße 6, D-52056 Aachen, Germany
Tel.: +49 (0)241 80-96734
Fax : +49 (0)241 80-92197
[EMAIL PROTECTED]

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


[R] png problem

2004-09-21 Thread Clément Calenge
Dear R-users,

I have a small problem with the function png(), when used with the
argument colortype=pseudo.cube.

  png(toto.png, colortype=pseudo.cube)
  image(matrix(rnorm(1), 100, 100))
  dev.off()

R is blocked at the last command (R does not
print any prompt after the last command). Nothing is
written in the file (Gimp indicates that the file is corrupted).
However,

  png(toto.png)
  image(matrix(rnorm(1), 100, 100))
  dev.off()

works fine.
I tried:

  options(X11colortype = pseudo.cube)
  png(toto.png)
  image(matrix(rnorm(1), 100, 100))
  dev.off()

But, here again, R is blocked. I tried to replace dev.off() by
graphics.off(), but this does not resolve the problem.
The problem does not occurs when the function X11() is used
instead of the function png().

I searched through the mail archive, the FAQ, on google,
but I did not found any solution to this problem.
On the help page on the function png(),
it is indicated that The colour handling will be that of the 'X11'
device in use.

I never used these functions before, but maybe png()
is not suitable with colortype=pseudo.cube ?
Can you tell me where I have missed something ?
Thanks in Advance,

Clément Calenge.

 version
  _
platform sparc-sun-solaris2.9
arch sparc
os   solaris2.9
system   sparc, solaris2.9
status
major1
minor9.1
year 2004
month06
day  21
language R

[[alternative HTML version deleted]]

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


Re: [R] unable to install dse package

2004-09-21 Thread aarthi ireddy
Error in file(file, r) : unable to open connection
In addition: Warning message:
cannot open file 'a:/project.txt'
 
please help


-

[[alternative HTML version deleted]]

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


[R] S-PLUS and R

2004-09-21 Thread lina1
Hello,

How do I import data from Excel onto R? I am using S-Plus Envstat module.
I need to use some of the data that already exist in the Envstat and put
it into R to make graphs, find basic informations like mean, median,
standard deviation, etc. I have been reading the help links, but I don't
see anything in reference to this.

Please help me!

-Maher Lina

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


Re: [R] unable to install dse package

2004-09-21 Thread aarthi ireddy
Error in file(file, r) : unable to open connection
In addition: Warning message:
cannot open file 'a:/project.txt'
 
please help


-

[[alternative HTML version deleted]]

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


Re: [R] unable to install dse package

2004-09-21 Thread Uwe Ligges
aarthi ireddy wrote:
Error in file(file, r) : unable to open connection
In addition: Warning message:
cannot open file 'a:/project.txt'
Error in question: Required information missing
In addition: Warning message:
Cannot reply if version of R, dse, and OS, as well as details about the 
way of installation are missing.
Warning message: Name of e-mail sender is missing

please help
Uwe Ligges

please help

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


Re: [R] S-PLUS and R

2004-09-21 Thread Uwe Ligges
[EMAIL PROTECTED] wrote:
Hello,
How do I import data from Excel onto R? I am using S-Plus Envstat module.
I need to use some of the data that already exist in the Envstat and put
it into R to make graphs, find basic informations like mean, median,
standard deviation, etc. I have been reading the help links, but I don't
see anything in reference to this.
Please help me!
See the R Data Import/Export Manual.
Uwe Ligges
-Maher Lina
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] unable to install dse package

2004-09-21 Thread Peter Dalgaard
aarthi ireddy [EMAIL PROTECTED] writes:

 Error in file(file, r) : unable to open connection
 In addition: Warning message:
 cannot open file 'a:/project.txt'

Er, what were you trying to do and why would you be reading from the
diskette? 

(Was there a previous message? I don't see it.)

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

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


RE: [R] S-PLUS and R

2004-09-21 Thread Wayne Jones
Save the excel file as a .csv file. 
The read about help(read.csv)

Regards

Wayne



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 21 September 2004 16:41
To: [EMAIL PROTECTED]
Subject: [R] S-PLUS and R 

Hello,

How do I import data from Excel onto R? I am using S-Plus Envstat module.
I need to use some of the data that already exist in the Envstat and put
it into R to make graphs, find basic informations like mean, median,
standard deviation, etc. I have been reading the help links, but I don't
see anything in reference to this.

Please help me!

-Maher Lina

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


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


RE: [R] unable to install dse package

2004-09-21 Thread Kahra Hannu
Error in file(file, r) : unable to open connection
In addition: Warning message:
cannot open file 'a:/project.txt'
 
please help
help(read.table)

Hannu Kahra

-

[[alternative HTML version deleted]]

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

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


[R] S-PLUS and R

2004-09-21 Thread Vito Ricci
Hi,

a shortcut to import data from an Excel sheet is:

In Excel
1) select cells including data
2) press CTRL+C (copy in clipboard)
open a window starting R

In R
type read.delim(clipboard,header=TRUE) 
if the are headers in excel data
or read.delim(clipboard,header=FALSE) 
if there are not headers 

See:

http://www.sciviews.org/_rgui/projects/RDcom.html
to use R in Excel.

Best
Vito
You wrote:

Hello,

How do I import data from Excel onto R? I am using
S-Plus Envstat module.
I need to use some of the data that already exist in
the Envstat and put
it into R to make graphs, find basic informations like
mean, median,
standard deviation, etc. I have been reading the help
links, but I don't
see anything in reference to this.

Please help me!

-Maher Lina

=
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



___

http://it.seriea.fantasysports.yahoo.com/

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


[R] Problems with boot and optim

2004-09-21 Thread Luke Keele
 
I am trying to bootstrap the parameters for a model that is estimated
through the optim() function and find that when I make the call to boot,
it runs but returns the exact same estimate for all of the bootstrap
estimates.  I managed to replicate the same problem using a glm() model
but was able to fix it when I made a call to the variables as data frame
by their exact names.  But no matter how I refer to the variables in the
het.fit function (see below) I get the same result.  I could bootstrap
it with the sample command and a loop, but then the analysis in the next
step isn't as nice
 
The code for the likelihood and the call to boot is below.  I have tried
numerous other permutations as well.
 
I am using R 1.9.1 on Windows XP pro.
 
Thanks
 
Luke Keele
 
 
#Define Likelihood
lik.hetprobit -function(par, X, Y, Z){
 
#Pull Out Parameters
Y - as.matrix(y)
X - as.matrix(x)
Z - as.matrix(z)
K -ncol(X)
M -ncol(Z)
b - as.matrix(par[1:K])
gamma - as.matrix(par[K+1:M])
 
mu - (X%*%b)
sd - exp(Z%*%gamma)
 
mu.sd -(mu/sd)
 
#Form Likelihood
 
   log.phi - pnorm(ifelse(Y == 0, -1, 1) * mu.sd, log.p = TRUE)
   2 * sum(log.phi)
}
 
y - as.matrix(abhlth)
x - as.matrix(reliten) 
ones = rep(1, nrow(x)) 
x = cbind(ones,x) 
z = as.matrix(abinfo)
 
data.het - as.matrix(cbind(y,x,z))
 
het.fit - function(data){
mod - optim(c(1,0,0), lik.hetprobit, Y=data$y, X=data$x, Z=data$z,
method=BFGS, 
   control=list(fnscale=-1), hessian=T)
c(mod$par)
}
case.fun - function(d,i)
het.fit(d[i,])
 
het.case - boot(data.het, case.fun, R=50)
Luke Keele
Post-Doctoral Fellow in Quantitative Methods
Nuffield College, Oxford University
Oxford, UK
 

[[alternative HTML version deleted]]

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


Re: [R] Bootstrap ICC estimate with nested data

2004-09-21 Thread Spencer Graves
 Have you considered simulate.lme in package nlme?  This is not 
bootstrapping, but it's not obvious to me how to bootstrap with a 
complicated structure and get anything with a simple interpretation.  
More information on this is provided in Pinhiero and Bates (2000) 
Mixed-Effects Models in S and S-Plus (Springer).  Bates is the primary 
architect of lme, nlme, etc.  I have found this book quite valuable. 

 hope this helps.  spencer graves
Andrew Robinson wrote:
Paul,
I think that you should account for the group structure.
My reading of Davison and Hinkley Bootstrap Methods and their
Application (1997, p. 100) suggests that for balanced data structures
with more than, say, 10 clusters, one should apply the bootstrap to
the clusters, but not within the clusters.  They provide some further
notes that you might find useful.
I hope that this helps.
Andrew
On Tue, Sep 21, 2004 at 03:41:29PM +0200, Bliese, Paul D MAJ USAMH wrote:
 

I would appreciate some thoughts on using the bootstrap functions in the
library bootstrap to estimate confidence intervals of ICC values
calculated in lme.
In lme, the ICC is calculated as tau/(tau+sigma-squared).  So, for instance
the ICC in the following example is 0.116:
   

tmod-lme(CINISMO~1,random=~1|IDGRUP,data=TDAT)
VarCorr(tmod)
 

IDGRUP = pdLogChol(1) 
   Variance  StdDev  
(Intercept) 0.1829931 0.42
Residual1.3907732 1.179310
   

0.18299/(0.18299+1.39077)
 

[1] 0.1162757
Using the bootstrap library, I can set up theta to do the ICC as follows:
   

theta-function(x,DATA){tmod-lme(CINISMO~1,random=~1|IDGRUP,data=DATA[x,])
 

OUT-as.numeric(VarCorr(tmod)[[1]])/(as.numeric(VarCorr(tmod)[[1]])+as.numer
ic(VarCorr(tmod)[[2]]))
return(OUT)}
Finally, I can run the bootstrap-t confidence limit function (or other
functions) as follows:
   

bootout-boott(1:nrow(TDAT),100,theta,data=TDAT)
 

This seems to work, but the estimates also seem strange.  For intance, the
observed ICC value is larger than the 95% confidence intervals provided by
the bootstrap.  It occurs to me that the results might be strange because
the sampling with replacement is being done without regard to group
membership.  That is, I might select individual 1 from group 1 10 times
(even though in the sample the group only has 5 members), and I might not
select any individuals from group 2.
My fundamental question is:  What are people's thoughts about using
bootstaping in nested data?  Does one have to sample with replacement taking
into consideration the group structure in the data?  If so, any suggestions
on how to do this?
Paul Bliese
US Army Medical Research Unit - Europe
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
   

 

--
Spencer Graves, PhD, Senior Development Engineer
O:  (408)938-4420;  mobile:  (408)655-4567
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] lme RE variance computation

2004-09-21 Thread Spencer Graves
 It may help to explicitly distinguish between parameter estimates 
and the true but unknown and unknowable reality that is assumed to 
have generated the data.  In that reality, all variance components are 
nonnegative.  Generally inferior algorithms can compute negative 
variance components.  These were quite useful prior to the advent of 
modern computers and software like the nlme package. 

 I suggest you think very carefully about the problem you want to 
solve.  I have found Pinheiro and Bates (2000) Mixed-Effects Models in S 
and S-Plus (Springer) quite helpful both in theory and in how to 
implement it.  Bates is the primary architect of lme, nlme, etc., and 
this book provides basic documentation for that package.  In particular, 
I would expect that simulate.lme could be quite useful if you have any 
doubts about any issue. 

 hope this helps.  spencer graves
Dimitris Rizopoulos wrote:
Hi Steve,
Estimation problems for the variance components in linear mixed models 
are usually occur for two reasons:

1. Due to model misspecification, i.e., using years instead of decades 
may show no variability in the slopes

2. Because the data do not support the assumptions of the linear mixed 
model (i.e., positive definite covariance matrix for the 
random-effects = increasing variance with time).

These may cause zero or even negative variance components. For more 
info you could take a look at Verbeke and Molenberghs (2000, Section 
5.6) and Searle, Casella and McCullogh (1992, Section 3.5).

I don't know the exact formulation you are using, but maybe you could 
consider an analogue of you model using gls, i.e.,

lme(..., random=~1|id)
gls(..., corr=corCompSymm(form=~1|id))
The references mentioned above are:
@Book{verbeke.molenberghs:00,
 author= {G. Verbeke and G. Molenberghs},
 title = {Linear Mixed Models for Longitudinal Data},
 year  = {2000},
 address   = {New York},
 publisher = {Springer-Verlag}
}
@Book{searle.et.al:92,
 author= {S. Searle and G. Cassela and C. McCulloch},
 title = {Variance Components},
 year  = {1992},
 address   = {New York},
 publisher = {Wiley}
}
I hope it helps.
Best,
Dimitris

Dimitris Rizopoulos
Ph.D. 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: Steve Roberts 
[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 21, 2004 1:38 PM
Subject: [R] lme RE variance computation


As I understand it lme (in R v1.9.x) estimates random effect variances
on a log scale, constraining them to be positive. Whilst this seems
sensible, it does lead to apparently biased estimates if the variance is
actually  zero - which makes our simulation results look strange. Whilst
we need to think a bit deeper about it - I still haven't got my head
around what a negative variance could mean - does anyone know a
way to take away the contraint and allowing zero or negative
variances?
Steve.  Dr Steve Roberts
 [EMAIL PROTECTED]
Senior Lecturer in Medical Statistics,
CMMCH NHS Trust and University of Manchester Biostatistics Group,
0161 275 5192 / 0161 276 5785
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

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

--
Spencer Graves, PhD, Senior Development Engineer
O:  (408)938-4420;  mobile:  (408)655-4567
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Lme warning with coef()

2004-09-21 Thread Doran, Harold
Hello

I routinely use the following without a problem:

fm1-lme(score~time,data,random=~time|ID)

tmp-coef(fm1, augFrame=T)

However, in my current situation, I am running into the following error
when I execute the coef() call

Error in tapply(as.character(object[[nm]]), groups, FUN[[dClass]]) : 
arguments must have same length

There are some cases with missing data, but I believe this was true in
prior successful attempts (although I do not recall exactly).

Any thoughts on this?

Thanks,

Harold



[[alternative HTML version deleted]]

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


[R] constrained optimization in R

2004-09-21 Thread Jason . L . Higbee
R:

I need to minimize a function such that the parameters when used in 
another function result in a particular value, which i fix.  That is, I 
need min(f(a,b)) given g(a,b)=X, where min(.) is the minimum, f(.) and 
g(.) are functions (with unknown gradients) of parameters a and b and X is 
a fixed value.  What optimization function(s) in R do you suggest? 
constrOptim looks like it will work except I don't know the gradient of 
the functions.

Thanks,

Jason Higbee

[[alternative HTML version deleted]]

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


Re: [R] R 1.9.1 Fails to Start on WinXP SP2

2004-09-21 Thread Duncan Murdoch
On Tue, 21 Sep 2004 09:59:31 -0500, Scott Higginbotham
[EMAIL PROTECTED] wrote :

I have two computers both of which are running Windows XP SP2. R 1.9.1
runs just fine on one but not the other. Both installations of R came
from the same installation package. When I click on the desktop icon an
hourglass shows up then disappears. Similarly, if I start RGUI the
process shows up in task-manager then abruptly disappears.
Interestingly, I can access R in Excel via the D(COM) Server on both
computers.

Any ideas?

Not a one!  Could you please try the beta build available on CRAN at

http://cran.r-project.org/bin/windows/base/rdevel.html

Thanks!

Duncan Murdoch

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


Re: [R] constrained optimization in R

2004-09-21 Thread Spencer Graves
 Have you considered doing an unconstrained penalized optimization, 
e.g.

  pen.f(x, X, penalty) = function(x)(f(x[1], x[2])+penalty*(g(x[1], 
x[2])-X)^2)

   Then give pen.f to optim.  Start out with penalty small, 
then use optim's answers with one value of penalty as starting values 
for optim with double or 10 times the penalty.  As long as f and g are 
reasonably well behaved, this should produce an answer without excessive 
effort. 

  hope this helps.  spencer graves  

[EMAIL PROTECTED] wrote:
R:
I need to minimize a function such that the parameters when used in 
another function result in a particular value, which i fix.  That is, I 
need min(f(a,b)) given g(a,b)=X, where min(.) is the minimum, f(.) and 
g(.) are functions (with unknown gradients) of parameters a and b and X is 
a fixed value.  What optimization function(s) in R do you suggest? 
constrOptim looks like it will work except I don't know the gradient of 
the functions.

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

--
Spencer Graves, PhD, Senior Development Engineer
O:  (408)938-4420;  mobile:  (408)655-4567
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] R 1.9.1 Fails to Start on WinXP SP2

2004-09-21 Thread Scott Higginbotham

I should have noted in my first post that I had already tried that to no
avail.

Scott

-Original Message-
From: Duncan Murdoch [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 21, 2004 1:35 PM
To: Scott Higginbotham
Cc: [EMAIL PROTECTED]
Subject: Re: [R] R 1.9.1 Fails to Start on WinXP SP2

On Tue, 21 Sep 2004 09:59:31 -0500, Scott Higginbotham
[EMAIL PROTECTED] wrote :

I have two computers both of which are running Windows XP SP2. R 1.9.1
runs just fine on one but not the other. Both installations of R came
from the same installation package. When I click on the desktop icon an
hourglass shows up then disappears. Similarly, if I start RGUI the
process shows up in task-manager then abruptly disappears.
Interestingly, I can access R in Excel via the D(COM) Server on both
computers.

Any ideas?

Not a one!  Could you please try the beta build available on CRAN at

http://cran.r-project.org/bin/windows/base/rdevel.html

Thanks!

Duncan Murdoch

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


Re: [R] asypow.noncent: how does it work?

2004-09-21 Thread Kjetil Brinchmann Halvorsen
[EMAIL PROTECTED] wrote:
I am trying to do power calculations for the proportional odds model using the asypow 
library.
The code
noncenta90b10-asypow.noncent(theta.ha=a9010,info.mat=infomatrixa90b10,constraints=constrt)
returns
Error in max(..., na.rm = na.rm) : invalid mode of argument.
the various arguments I've used are:
a9010
  [,1]
[1,] -1.7357568
[2,] -0.1928619
specifying the theta.ha array as a row not a column makes no difference
 

infomatrixa90b10
   

[,1] [,2]
[1,]  0.967005807 -0.004699262
[2,] -0.004699262  0.903852346
 
 

constrt
   

[,1] [,2] [,3]   
[1,] 1  a  -1.92861865194525
[2,] 1  b  0

I'm probably missing something very simple, but I can't see what it is.  Can 
anyone help?
 

Problem is with your constarint matrix. From the help file (which 
admittedlt could be clearer)
constrain is a 3-column matrix. First element in a row should be 1 to 
indicate a param set == to a value,
2 to indicate equality of two params. You put 1, so we assume first 
case.  Second row element should be , in this case,
index of param set to value, and cannot be a or b. Lets suppose 
yours are first and second parameter, then it shoud be 1 and 2, 
respectively.
Finally, in this case, third row element should be value.

So you should use something like
constrt - matrix( c(1,1,-1.9286, 1,2,0), 2, 3, byrow=TRUE)
and then, using your values for the other arguments,
 asypow.noncent(a9010, infomatrix, constrt)
$w
  [,1]
[1,] 0.06993048
$df
[1] 2
Kjetil
--
Kjetil Halvorsen.
Peace is the most effective weapon of mass construction.
  --  Mahdi Elmandjra
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] constrained optimization in R

2004-09-21 Thread Thomas Lumley
On Tue, 21 Sep 2004 [EMAIL PROTECTED] wrote:
R:
I need to minimize a function such that the parameters when used in
another function result in a particular value, which i fix.  That is, I
need min(f(a,b)) given g(a,b)=X, where min(.) is the minimum, f(.) and
g(.) are functions (with unknown gradients) of parameters a and b and X is
a fixed value.  What optimization function(s) in R do you suggest?
constrOptim looks like it will work except I don't know the gradient of
the functions.
constrOptim won't work -- it does INequality constraints.
-thomas

Thanks,
Jason Higbee
[[alternative HTML version deleted]]
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Thomas Lumley   Assoc. Professor, Biostatistics
[EMAIL PROTECTED]   University of Washington, Seattle
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Ever see a stata import problem like this?

2004-09-21 Thread Paul Johnson
Greetings Everybody:
I generated a 1.2MB dta file based on the general social survey with 
Stata8 for linux. The file can be re-opened with Stata, but when I bring 
it into R, it says all the values are missing for most of the variables.

This dataset is called morgen.dta and I dropped a copy online in case 
you are interested

http://www.ku.edu/~pauljohn/R/morgen.dta
looks like this to R (I tried various options on the read.dta command):
 myDat - read.dta(morgen.dta)
 summary(myDat)
 CASEID  yearid hrs1 hrs2
Min.   :   19721   Min.   :1972   Min.   :   1   NAP :0   NAP :0
1st Qu.: 1983475   1st Qu.:1978   1st Qu.: 445   DK  :0   DK  :0
Median : 1996808   Median :1987   Median : 905   NA  :0   NA  :0
Mean   : 9963040   Mean   :1986   Mean   : 990   NA's:40933   NA's:40933
 3rd Qu.:19872187   3rd Qu.:1994   3rd Qu.:1358
 Max.   :20002817   Max.   :2000   Max.   :3247
  prestige  agewedage  educpaeduc
 DK,NA,NAP:0   NAP :0   DK  :0   NAP :0   NAP :0
 NA's :40933   DK  :0   NA  :0   DK  :0   DK  :0
   NA  :0   NA's:40933   NA  :0   NA  :0
   NA's:40933NA's:40933   NA's:40933

  maeduc   speduc income
 NAP :0   NAP :0   $25000 OR MORE:14525
 DK  :0   DK  :0   $1 - 14999: 5022
 NA  :0   NA  :0   $15000 - 1: 3869
 NA's:40933   NA's:40933   $2 - 24999: 3664
   REFUSED   : 1877
   (Other)   : 8523
   NA's  : 3453

Here's what Stata sees when I load the same thing:
summarize, detail
 Case identification number
-
  Percentiles  Smallest
 1%   197432  19721
 5%   199649  19722
10%  1974116  19723   Obs   40933
25%  1983475  19724   Sum of Wgt.   40933
50%  1996808  Mean9963040
Largest   Std. Dev.   9006352
75% 1.99e+07   2.00e+07
90% 2.00e+07   2.00e+07   Variance   8.11e+13
95% 2.00e+07   2.00e+07   Skewness .18931
99% 2.00e+07   2.00e+07   Kurtosis   1.045409
GSS YEAR FOR THIS RESPONDENT
-
  Percentiles  Smallest
 1% 1972   1972
 5% 1973   1972
10% 1974   1972   Obs   40933
25% 1978   1972   Sum of Wgt.   40933
50% 1987  Mean   1986.421
Largest   Std. Dev.   8.61136
75% 1994   2000
90% 1998   2000   Variance   74.15552
95% 2000   2000   Skewness  -.0789223
99% 2000   2000   Kurtosis   1.799939
RESPONDENT ID NUMBER
-
  Percentiles  Smallest
 1%   18  1
 5%   89  1
10%  178  1   Obs   40933
25%  445  1   Sum of Wgt.   40933
50%  905  Mean   989.9129
Largest   Std. Dev.  689.0596
75% 1358   3244
90% 2027   3245   Variance   474803.2
95% 2437   3246   Skewness   .8359211
99% 2867   3247   Kurtosis   3.311248
  NUMBER OF HOURS WORKED LAST WEEK
-
  Percentiles  Smallest
 1%6  0
 5%   15  0
10%   21  0   Obs   23279
25%   37  0   Sum of Wgt.   23279
50%   40  Mean   41.05206
Largest   Std. Dev.  13.95931
75%   48 89
90%   60 89   Variance   194.8624
95%   65 89   Skewness.195045
99%   82 89   Kurtosis   4.448998
 NUMBER OF HOURS USUALLY WORK A WEEK
-
  Percentiles  Smallest
 1%4  0
 5%   15  0
10%   20  1   Obs 774
25%   38  2   Sum of Wgt. 774
50%   40  Mean   39.79199
Largest   Std. Dev.  13.43383
75%   45 89
90%   55 89   Variance   180.4677
95%   60 89 

[R] RMySQL and Blob

2004-09-21 Thread jonathan_li
Dear R experts,

Does RMySQL package handle Blob datatype in a MySQL database? Blob can represent an 
image, a sound or some other 
large and complex binary objects. In an article published by R-database special 
interest group, named A common database interface (DBI) (updated June 2003),  it's 
mentioned in open issues and limitations that We need to carefully plan how to deal 
with binary objects. 

Before I invest time to try, I would appreciate any experts' opinions.

Thanks,
Jonathan

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


Re: [R] Ever see a stata import problem like this?

2004-09-21 Thread Thomas Lumley
On Tue, 21 Sep 2004, Paul Johnson wrote:
Greetings Everybody:
I generated a 1.2MB dta file based on the general social survey with Stata8 
for linux. The file can be re-opened with Stata, but when I bring it into R, 
it says all the values are missing for most of the variables.
You need read.dta( ,convert.factors=FALSE)
You have variables with labels for some, but not all, of their values. 
When these are converted to R factors you lose the unlabelled values.  R 
does not have a data type that is sometimes labelled and sometimes 
numeric.

When you use convert.factors=FALSE the label information is still read in 
and returned as an attribute of the data frame, so you can set individual 
variables to be factors.

-thomas

This dataset is called morgen.dta and I dropped a copy online in case you 
are interested

http://www.ku.edu/~pauljohn/R/morgen.dta
looks like this to R (I tried various options on the read.dta command):
myDat - read.dta(morgen.dta)
summary(myDat)
CASEID  yearid hrs1 hrs2
Min.   :   19721   Min.   :1972   Min.   :   1   NAP :0   NAP :0
1st Qu.: 1983475   1st Qu.:1978   1st Qu.: 445   DK  :0   DK  :0
Median : 1996808   Median :1987   Median : 905   NA  :0   NA  :0
Mean   : 9963040   Mean   :1986   Mean   : 990   NA's:40933   NA's:40933
3rd Qu.:19872187   3rd Qu.:1994   3rd Qu.:1358
Max.   :20002817   Max.   :2000   Max.   :3247
 prestige  agewedage  educpaeduc
DK,NA,NAP:0   NAP :0   DK  :0   NAP :0   NAP :0
NA's :40933   DK  :0   NA  :0   DK  :0   DK  :0
  NA  :0   NA's:40933   NA  :0   NA  :0
  NA's:40933NA's:40933   NA's:40933

 maeduc   speduc income
NAP :0   NAP :0   $25000 OR MORE:14525
DK  :0   DK  :0   $1 - 14999: 5022
NA  :0   NA  :0   $15000 - 1: 3869
NA's:40933   NA's:40933   $2 - 24999: 3664
  REFUSED   : 1877
  (Other)   : 8523
  NA's  : 3453


Here's what Stata sees when I load the same thing:
summarize, detail
Case identification number
-
 Percentiles  Smallest
1%   197432  19721
5%   199649  19722
10%  1974116  19723   Obs   40933
25%  1983475  19724   Sum of Wgt.   40933
50%  1996808  Mean9963040
   Largest   Std. Dev.   9006352
75% 1.99e+07   2.00e+07
90% 2.00e+07   2.00e+07   Variance   8.11e+13
95% 2.00e+07   2.00e+07   Skewness .18931
99% 2.00e+07   2.00e+07   Kurtosis   1.045409
   GSS YEAR FOR THIS RESPONDENT
-
 Percentiles  Smallest
1% 1972   1972
5% 1973   1972
10% 1974   1972   Obs   40933
25% 1978   1972   Sum of Wgt.   40933
50% 1987  Mean   1986.421
   Largest   Std. Dev.   8.61136
75% 1994   2000
90% 1998   2000   Variance   74.15552
95% 2000   2000   Skewness  -.0789223
99% 2000   2000   Kurtosis   1.799939
   RESPONDENT ID NUMBER
-
 Percentiles  Smallest
1%   18  1
5%   89  1
10%  178  1   Obs   40933
25%  445  1   Sum of Wgt.   40933
50%  905  Mean   989.9129
   Largest   Std. Dev.  689.0596
75% 1358   3244
90% 2027   3245   Variance   474803.2
95% 2437   3246   Skewness   .8359211
99% 2867   3247   Kurtosis   3.311248
 NUMBER OF HOURS WORKED LAST WEEK
-
 Percentiles  Smallest
1%6  0
5%   15  0
10%   21  0   Obs   23279
25%   37  0   Sum of Wgt.   23279
50%   40  Mean   41.05206
   Largest   Std. Dev.  13.95931
75%   48 89
90%   60 89   Variance   194.8624
95%   65 89   Skewness.195045
99%   82 89   Kurtosis   4.448998
NUMBER OF HOURS USUALLY WORK A WEEK
-
 

Re: [R] R 1.9.1 Fails to Start on WinXP SP2

2004-09-21 Thread Duncan Murdoch
On Tue, 21 Sep 2004 14:15:51 -0500, Scott Higginbotham
[EMAIL PROTECTED] wrote:


I should have noted in my first post that I had already tried that to no
avail.

In that case, things aren't easy.  You need to see where in the
startup sequence it's bailing out.  We don't have debug code installed
to do that (because this isn't a common problem!), so the only way I
know to find that is to compile R with debug information, and run it
under a debugger.  If you've never done that, it's a big job.

Duncan Murdoch



Scott

-Original Message-
From: Duncan Murdoch [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 21, 2004 1:35 PM
To: Scott Higginbotham
Cc: [EMAIL PROTECTED]
Subject: Re: [R] R 1.9.1 Fails to Start on WinXP SP2

On Tue, 21 Sep 2004 09:59:31 -0500, Scott Higginbotham
[EMAIL PROTECTED] wrote :

I have two computers both of which are running Windows XP SP2. R 1.9.1
runs just fine on one but not the other. Both installations of R came
from the same installation package. When I click on the desktop icon an
hourglass shows up then disappears. Similarly, if I start RGUI the
process shows up in task-manager then abruptly disappears.
Interestingly, I can access R in Excel via the D(COM) Server on both
computers.

Any ideas?

Not a one!  Could you please try the beta build available on CRAN at

http://cran.r-project.org/bin/windows/base/rdevel.html

Thanks!

Duncan Murdoch

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

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


Re: [R] R 1.9.1 Fails to Start on WinXP SP2

2004-09-21 Thread Duncan Murdoch
One other suggestion:

Run the msconfig System configuration utility to turn off most of
the software that loads on your machine at startup, and see if that
allows R to start.  Then gradually add it back until you find the
culprit, if there is one.

Duncan Murdoch

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


RE: [R] R 1.9.1 Fails to Start on WinXP SP2

2004-09-21 Thread Liaw, Andy
Perhaps a couple of things to try before that:

1. See what Rterm.exe does.
2. See whether it makes any difference if the --vanilla flag is added to the
shortcut to Rgui.exe.  (E.g., was Rgui trying to load an existing .rda file
or execute some startup code on the computer that had the problem, and
otherwise on the other?)

Andy

 From: Duncan Murdoch
 
 On Tue, 21 Sep 2004 14:15:51 -0500, Scott Higginbotham
 [EMAIL PROTECTED] wrote:
 
 
 I should have noted in my first post that I had already 
 tried that to no
 avail.
 
 In that case, things aren't easy.  You need to see where in the
 startup sequence it's bailing out.  We don't have debug code installed
 to do that (because this isn't a common problem!), so the only way I
 know to find that is to compile R with debug information, and run it
 under a debugger.  If you've never done that, it's a big job.
 
 Duncan Murdoch
 
 
 
 Scott
 
 -Original Message-
 From: Duncan Murdoch [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, September 21, 2004 1:35 PM
 To: Scott Higginbotham
 Cc: [EMAIL PROTECTED]
 Subject: Re: [R] R 1.9.1 Fails to Start on WinXP SP2
 
 On Tue, 21 Sep 2004 09:59:31 -0500, Scott Higginbotham
 [EMAIL PROTECTED] wrote :
 
 I have two computers both of which are running Windows XP 
 SP2. R 1.9.1
 runs just fine on one but not the other. Both installations 
 of R came
 from the same installation package. When I click on the 
 desktop icon an
 hourglass shows up then disappears. Similarly, if I start RGUI the
 process shows up in task-manager then abruptly disappears.
 Interestingly, I can access R in Excel via the D(COM) Server on both
 computers.
 
 Any ideas?
 
 Not a one!  Could you please try the beta build available on CRAN at
 
 http://cran.r-project.org/bin/windows/base/rdevel.html
 
 Thanks!
 
 Duncan Murdoch
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


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


[R] ordered probit and cauchit

2004-09-21 Thread roger koenker
What is the current state of the R-art for ordered probit models, and 
more
esoterically is there any available R strategy for ordered cauchit 
models,
i.e. ordered multinomial alternatives with a cauchy link function.  MCMC
is an option, obviously, but for a univariate latent variable model 
this seems
to be overkill... standard mle methods should be preferable.  (??)

Googling reveals that spss provides such functions... just to wave a red
flag.
url:www.econ.uiuc.edu/~rogerRoger Koenker
email   [EMAIL PROTECTED]   Department of Economics
vox:217-333-4558University of Illinois
fax:217-244-6678Champaign, IL 61820
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] png problem

2004-09-21 Thread Paul Murrell
Hi
Clément Calenge wrote:
Dear R-users,
I have a small problem with the function png(), when used with the
argument colortype=pseudo.cube.
  png(toto.png, colortype=pseudo.cube)
  image(matrix(rnorm(1), 100, 100))
  dev.off()
R is blocked at the last command (R does not
print any prompt after the last command). Nothing is
written in the file (Gimp indicates that the file is corrupted).

Did you wait long enough?  This example took a little while to complete 
for me (may need someone more familiar with the code to tell us why it 
is so slow).

Paul

However,
  png(toto.png)
  image(matrix(rnorm(1), 100, 100))
  dev.off()
works fine.
I tried:
  options(X11colortype = pseudo.cube)
  png(toto.png)
  image(matrix(rnorm(1), 100, 100))
  dev.off()
But, here again, R is blocked. I tried to replace dev.off() by
graphics.off(), but this does not resolve the problem.
The problem does not occurs when the function X11() is used
instead of the function png().
I searched through the mail archive, the FAQ, on google,
but I did not found any solution to this problem.
On the help page on the function png(),
it is indicated that The colour handling will be that of the 'X11'
device in use.
I never used these functions before, but maybe png()
is not suitable with colortype=pseudo.cube ?
Can you tell me where I have missed something ?
Thanks in Advance,
Clément Calenge.
 version
  _
platform sparc-sun-solaris2.9
arch sparc
os   solaris2.9
system   sparc, solaris2.9
status
major1
minor9.1
year 2004
month06
day  21
language R
[[alternative HTML version deleted]]
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

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


Re: [R] lda predict

2004-09-21 Thread Prof Brian Ripley
On Tue, 21 Sep 2004, rob foxall (IFR) wrote:

 Dear R-helpers,
 
 I have a model created by lda, and I would like to use this
 model to make predictions for new or old data. The catch is, I want to
 do this without using the predict function, i.e. only using
 information directly from the foo.lda object to create my posterior
 probabilities. 

Well, that's what predict.lda does, so please read its code.

 In anticipation of likely responses, I will be brushing
 up my lda knowledge using the given references when I have time, but am
 being hassled for an answer asap!


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