Re: [R] Std Err on Concentration measures
Angelo Secchi wrote: Hi, I'm using the ineq package to calculate some concentration measures (Gini, Herfindal, ...) and I was wondering if there's around also a function to calculate standard error on these measures. If not, is anybody aware of where I can find a reference on this point? Thanks. There are several suggestions for estimating the variance of the Gini coefficient:a literature search should reveal some suggestions. If the sampling design is complex, you may be best off using a resampling method, such as bootstrap. Here are a few references: @Article{nayakandgastwirth1989, Author = {Tapan K Nayak and Joseph L Gastwirth}, Title = {The use of diversity analysis to assess the relative influence of factors affecting the income distribution}, Journal= {Journal of Business \ Economic Statistics}, Volume = {7}, Pages = {453--460}, subject= {Asymptotic distribution Diversity measure Gini index U statistic Utility function}, year = 1989, month = oct, } @Article{sandstromwretmanandwalden1988a, Author = {Arne Sandström and Jan Wretman and Bertil Walden}, Title = {Variance estimators of the Gini coefficient - probability sampling}, Journal= {Journal of Business \ Economic Statistics}, Volume = {6}, Pages = {113--119}, subject= {Simulations}, year = 1988, month = jan, } @Article{davidsonandduclos1997, Author = {Russell Davidson and Jean-Yves Duclos}, Title = {Statistical inference for the measurement of the incidence of taxes and transfers}, Journal= {Econometrica}, Volume = {65}, Number = {6}, Pages = {1453--1465}, month = {November}, year = 1997, } cheers, markus -- Markus Jantti Abo Akademi University [EMAIL PROTECTED] http://www.iki.fi/~mjantti ### This message has been scanned by F-Secure Anti-Virus for Mic...{{dropped}} __ R-help@stat.math.ethz.ch 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] proportional matrix rows
Hi I have a two-column integer matrix like this: R jj [,1] [,2] [1,] -11 [2,] -22 [3,] -76 [4,] -87 [5,] -65 [6,] -98 [7,] -54 [8,]3 -3 [9,] -109 [10,] -43 I want a diagnostic that detects whether a row is a multiple of the first row or not. In this case, this would be rows 1,2, and 8. How to do this nicely? Sometimes the first row has a zero, so the method would have to work on [,1] [,2] [1,]01 [2,]11 [3,]08 [4,]0 -4 [5,]00 [6,]40 in which case rows 1,3,4,5 are multiples. It'd be nice to have a solution that works for any number of columns. -- Robin Hankin Uncertainty Analyst Southampton Oceanography Centre European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-help@stat.math.ethz.ch 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] RODBC working in Rgui but not Rterm
On Mon, 7 Feb 2005, John Fox wrote: Dear Shlomo, Just last week I experienced a similar problem with RODBC and MySQL under Windows, though the problem extended to both Rterm *and* Rgui. After a fair amount of detective work, I discovered that the source of the difficulty was a newly downloaded MySQL ODBC Windows driver. When I instead installed a driver downloaded last December, everything worked fine. I've just confirmed that I can access MySQL from both Rterm and Rgui. I'm using R 2.0.1 under Windows XP. Since your symptoms are slightly different from mine, the ODBC driver may not be the source of the difficulty, but I thought that it might be worthwhile to mention it. There are two problems here 1) The latest MyODBC (3.51-10) has a problem that 3.51-07 did not have, as I found yesterday on both Linux and Windows (I am preparing an RODBC update). I've now read the sources, and it has a logic bug: it throws the error state IM008 Invalid window handle for connection completion argument whether or not any completion is needed. RODBC 1.1-3 will have a workaround for this. 2) There _is_ a documented difference between RGui and Rterm: see ?odbcConnect: Under the Windows GUI, specifying an incomplete 'connection', for example the default '', will bring up a dialog box to complete the information required. (This does not work from 'Rterm.exe' unless a driver is specified, a Windows restriction.) As a result of these two, MyODBC 3.51-10 ought to work under RGui and not under Rterm. Moral: if you can, downgrade your MyODBC driver, or wait for RODBC_1.1-3 Brian -- 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 __ R-help@stat.math.ethz.ch 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] Environment of a formula
Gabor == Gabor Grothendieck [EMAIL PROTECTED] on Mon, 7 Feb 2005 04:39:40 + (UTC) writes: Adrian Baddeley adrian at maths.uwa.edu.au writes: : I want to equip a data frame with an attribute : which specifies how to plot some of the columns. : : Up to now we have been doing this by giving the data frame : a `formula' attribute, that can be passed to plot.formula. : : For example : dat - data.frame(x=1:100,y=runif(100),z=100:1) : attr(dat, plotme) - (z ~ x) : .. : .. : if(missing(desiredformula)) : desiredformula - attr(dat, plotme) : plot(desiredformula, data=dat) : : We just got bitten by the fact that a formula object has a `.Environment' : attribute, which may be huge, depending on the environment : in which the formula was created. In the example above there is : no upper limit on the size of the object 'dat' : That is, environment(attr(dat, plotme)) could be huge. Gabor Do you mean that if fo is the formula then ls(environment(fo)) Gabor has many large components? I don't understand why that would Gabor be a problem. maybe Adrian save()s that data.frame susequently? Then, I assume the environment will copied. In all(?) other circumstances that should only be a pointer and not really use much memory. Martin __ R-help@stat.math.ethz.ch 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] Environment of a formula
On Mon, 7 Feb 2005 04:39:40 + (UTC), Gabor Grothendieck [EMAIL PROTECTED] wrote : Adrian Baddeley adrian at maths.uwa.edu.au writes: : I want to equip a data frame with an attribute : which specifies how to plot some of the columns. : : Up to now we have been doing this by giving the data frame : a `formula' attribute, that can be passed to plot.formula. : : For example : dat - data.frame(x=1:100,y=runif(100),z=100:1) : attr(dat, plotme) - (z ~ x) : .. : .. : if(missing(desiredformula)) : desiredformula - attr(dat, plotme) : plot(desiredformula, data=dat) : : We just got bitten by the fact that a formula object has a `.Environment' : attribute, which may be huge, depending on the environment : in which the formula was created. In the example above there is : no upper limit on the size of the object 'dat' : That is, environment(attr(dat, plotme)) could be huge. Do you mean that if fo is the formula then ls(environment(fo)) has many large components? I don't understand why that would be a problem. It can be a problem when you save a workspace. For example, the .Rdata file produced by this session is tiny: makef - function() { + y ~ x + } fo - makef() save.image() while the file produced by this session is around 8 megabytes: makef - function() { + z - rnorm(100) + y ~ x + } fo - makef() save.image() You might assume that since z is local to the makef() call, and never referenced by the formula, it wouldn't be saved: but you'd be wrong. : It appears that we can't set the environment to NULL; : should we set it to the Global environment e.g. using as.formula? It works for me (R 2.1.0 Windows): R fo - y~x R environment(fo) environment: R_GlobalEnv R environment(fo) - NULL R environment(fo) NULL It works for me too, so I'm not sure what problem Adrian was having. Duncan Murdoch __ R-help@stat.math.ethz.ch 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] Rmatlab
Dear all, I came across recently to the Rmatlab package (http://www.omegahat.org/RMatlab/) that allows R and Matlab to talk to each other. I made several attempts to install it on my Mac but without any success as some headers seem to miss. I am just wondering if anyone has already tried and successfully used RMatlab. According to the website, this should run on unix machines and I was surprised that it couldn't be true for Mac as the OS X, Linux and Unix Matlab architectures are pretty much similar. Any inputs would be great! Thanks in advance for your help. David PS: I am currently using Matlab v 13 and R2.0.1 __ R-help@stat.math.ethz.ch 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] questions sur R
bonjour, Je suis actuellement en derniere annee d'ecole d'ingenieur en informatique et statistiques et je dois réaliser mon projet de fin d'études sur le logiciel R. En fait, je dois réaliser un scoring sous R puis le meme sous SAS et comparer les resultats. Mon fichier se prete à une regression logistique. J'ai donc utilisé la fonction glm sous R et Catmod sous SAS seumement, je ne parviens pas au meme resultats, les estimateurs different d'une methode a l'autre. Avez vous une idee d'ou peut provenir cette difference? Je vous remercie d'avance Cordialement, - mails ! [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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] logit link + alternatives
Help needed with lm function: Dear R's, Could anyone tell me how to replace the link function (probit logit, loglog etc.) in lm with an abitrary user-defined function? The task is to perform ML Estimation of betas for a dichotome target variable. Maybe there is already a package for this (I did not find one). Any hints or a code excerpt would be welcome! Thank you -Jeff jeff.pr2 (at) added-insight (dot) net __ R-help@stat.math.ethz.ch 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] questions sur R
nathalie bouez wrote: bonjour, Je suis actuellement en derniere annee d'ecole d'ingenieur en informatique et statistiques et je dois réaliser mon projet de fin d'études sur le logiciel R. En fait, je dois réaliser un scoring sous R puis le meme sous SAS et comparer les resultats. Mon fichier se prete à une regression logistique. J'ai donc utilisé la fonction glm sous R et Catmod sous SAS seumement, je ne parviens pas au meme resultats, les estimateurs different d'une methode a l'autre. Avez vous une idee d'ou peut provenir cette difference? Je vous remercie d'avance 1. This list is in english... 2. R is not SAS. 3. Quite probably you are applying different methods in SAS and in R, please read the corresponding documentation. 4. You have to specify a reproducible example, if you want some more precise answers. Just saying glm() is different from some (not fruther mentioned) procedure in SAS isn't that helpful ... Please read the posting guide (see last line of this message). Uwe Ligges Cordialement, - mails ! [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] logit link + alternatives
see at ?glm and ?family and use, e.g., `family=binomial(link=probit)'. 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/336899 Fax: +32/16/337015 Web: http://www.med.kuleuven.ac.be/biostat/ http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm - Original Message - From: [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Monday, February 07, 2005 10:44 AM Subject: [R] logit link + alternatives Help needed with lm function: Dear R's, Could anyone tell me how to replace the link function (probit logit, loglog etc.) in lm with an abitrary user-defined function? The task is to perform ML Estimation of betas for a dichotome target variable. Maybe there is already a package for this (I did not find one). Any hints or a code excerpt would be welcome! Thank you -Jeff jeff.pr2 (at) added-insight (dot) net __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] logit link + alternatives
I am not sure that fully answers Jeff's question. If the available link functions (even with the quasi family) are not sufficient for your needs, then you need to make your own constructor for a family object - which provides the necessary information to the glm engine - and use this as the family argument in your call to glm. Specifically, you need to make a copy of the binomial() function and replace the call to make.link(). Martyn On Mon, 2005-02-07 at 11:27 +0100, Dimitris Rizopoulos wrote: see at ?glm and ?family and use, e.g., `family=binomial(link=probit)'. Best, Dimitris - Original Message - From: [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Monday, February 07, 2005 10:44 AM Subject: [R] logit link + alternatives Help needed with lm function: Dear R's, Could anyone tell me how to replace the link function (probit logit, loglog etc.) in lm with an abitrary user-defined function? The task is to perform ML Estimation of betas for a dichotome target variable. Maybe there is already a package for this (I did not find one). Any hints or a code excerpt would be welcome! Thank you -Jeff jeff.pr2 (at) added-insight (dot) net __ R-help@stat.math.ethz.ch 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] questions sur R
Hi, you can see this link: http://www.kb.u-psud.fr/kb/acces-etudiant/cours/biostat/html/Syntaxe%20et%20listings%20CUSSV/html/glm.htm The R functions (ex. glm, polr) were compared to the SAS procédures (ex. proc logistic, genmod). perhaps the solution of your problem is here. P.BADY At 10:51 07/02/2005 +0100, nathalie bouez wrote: bonjour, Je suis actuellement en derniere annee d'ecole d'ingenieur en informatique et statistiques et je dois réaliser mon projet de fin d'études sur le logiciel R. En fait, je dois réaliser un scoring sous R puis le meme sous SAS et comparer les resultats. Mon fichier se prete à une regression logistique. J'ai donc utilisé la fonction glm sous R et Catmod sous SAS seumement, je ne parviens pas au meme resultats, les estimateurs different d'une methode a l'autre. Avez vous une idee d'ou peut provenir cette difference? Je vous remercie d'avance Cordialement, - mails ! [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Pierre BADY °) Université Claude Bernard Lyon 1 UMR CNRS 5023, LEHF bat Alphonse Forel 43 boulevard du 11 novembre 1918 F-69622 VILLEURBANNE CEDEX FRANCE TEL : +33 (0)4 72 44 62 34 FAX : +33 (0)4 72 43 28 92 MEL : [EMAIL PROTECTED] http://limnologie.univ-lyon1.fr http://pierre.bady.free.fr (in construction) [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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] Sweave and connections
I'm learning to use Sweave (it's really great!) and everything works fine, except that occasionally I get, after having sweaved many times, -- Sweave(report.Snw) Writing to file report.tex Processing code chunks ... 1 : term hide Error: chunk 1 Error in file(file, encoding = encoding) : All connections are in use -- This is no big problem, since it helps to close and reopen the R session, but I wonder if I can avoid this, by closing connections or something similar. (I really have no idea of what is going on!) This is R : Version 2.1.0 Under development (unstable) (2005-01-19) on Debian. -- Göran Broströmtel: +46 90 786 5223 Department of Statistics fax: +46 90 786 6614 Umeå University http://www.stat.umu.se/egna/gb/ SE-90187 Umeå, Sweden e-mail: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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] Environment of a formula
From: Martin Maechler [EMAIL PROTECTED] maybe Adrian save()s that data.frame susequently? Then, I assume the environment will copied. In all(?) other circumstances that should only be a pointer and not really use much memory. Yes, sorry for the garbled message, it is only when the object containing the formula is save()d that we have a problem with huge file size. A __ R-help@stat.math.ethz.ch 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] Sweave and connections
On Mon, 7 Feb 2005 12:32:13 +0100, Göran Broström (GB) wrote: I'm learning to use Sweave (it's really great!) and everything works fine, except that occasionally I get, after having sweaved many times, -- Sweave(report.Snw) Writing to file report.tex Processing code chunks ... 1 : term hide Error: chunk 1 Error in file(file, encoding = encoding) : All connections are in use -- This is no big problem, since it helps to close and reopen the R session, but I wonder if I can avoid this, by closing connections or something similar. (I really have no idea of what is going on!) This should happen only if you have errors in the Sweave document: then Sweave may have no chance to close the output file properly. showConnections() lists all open connections, and you may guess what closeAllConnections() does :-) HTH, Fritz -- --- Friedrich Leisch Institut für Statistik Tel: (+43 1) 58801 10715 Technische Universität WienFax: (+43 1) 58801 10798 Wiedner Hauptstraße 8-10/1071 A-1040 Wien, Austria http://www.ci.tuwien.ac.at/~leisch __ R-help@stat.math.ethz.ch 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] proportional matrix rows
Robin Hankin r.hankin at soc.soton.ac.uk writes: : : Hi : : I have a two-column integer matrix like this: : : R jj : :[,1] [,2] : [1,] -11 : [2,] -22 : [3,] -76 : [4,] -87 : [5,] -65 : [6,] -98 : [7,] -54 : [8,]3 -3 : [9,] -109 : [10,] -43 : : I want a diagnostic that detects whether a row is a multiple of : the first row or not. In this case, this would be rows 1,2, and 8. : : How to do this nicely? Sometimes the first row has a zero, so the : method would have to work on : : [,1] [,2] : [1,]01 : [2,]11 : [3,]08 : [4,]0 -4 : [5,]00 : [6,]40 : : : in which case rows 1,3,4,5 are multiples. It'd be nice to have : a solution that works for any number of columns. If rowi is a multiple of row1 then crossprod(cbind(row1, rowi)) is singular so: apply(mat, 1, function(x) det(crossprod(cbind(x, mat[1,] == 0 If your matrix only has two columns then crossprod(x) is singular iff x is so you can eliminate the crossprod. __ R-help@stat.math.ethz.ch 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] logit link + alternatives
On 07-Feb-05 [EMAIL PROTECTED] wrote: Help needed with lm function: Dear R's, Could anyone tell me how to replace the link function (probit logit, loglog etc.) in lm with an abitrary user-defined function? The task is to perform ML Estimation of betas for a dichotome target variable. Maybe there is already a package for this (I did not find one). Any hints or a code excerpt would be welcome! Thank you -Jeff I asked a similar question last year (2 April 2004) since I wanted a cauchy link in a binary response model (the data suggested heavy tails). I thought in the first place that I saw a fairly straightforward way to do it, but Brian Ripley's informed response put me off, once I had looked into the details of what would be involved (his reply which includes my original mail follows): # On Fri, 2 Apr 2004 [EMAIL PROTECTED] wrote: # # I am interested in extending the repertoire of link functions # in glm(Y~X, family=binomial(link=...)) to include a tan link: # # eta = (4/pi)*tan(mu) # # i.e. this link bears the same relation to the Cauchy distribution # as the probit link bears to the Gaussian. I'm interested in sage # advice about this from people who know their way aroung glm. # # From the surface, it looks as though it might just be a matter # of re-writing 'make.link' in the obvious sort of way so as to # incorporate tan, but I fear traps ... # # How are you going to do that? If you edit make.link and have your # own local copy, the namespace scoping will ensure that the system # copy gets used, and the code in binomial() will ensure that even # that does not get called except for the pre-coded list of links. # # What am I missing? # # You need a local, modified, copy of binomial, too, AFAICS. As I say, the implied details put me off for a while, but in this particular case Thomas W Yee came up with a ready-made solution (23 April 2004): # my VGAM package at www.stat.auckland.ac.nz/~yee # now has the tan link for binomialff(). # It is tan(pi*(mu-0.5)). (See his full mail in the R-help archives for April 2004 for several important details regarding this implementation). So: it would seem to be quite possible to write yor own link function, but it would take quite a bit of work and would involves re-writing at least the codes for 'make.link' and for 'binomial', and being careful about how you use them. Hoping this helps, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 07-Feb-05 Time: 12:57:07 -- XFMail -- __ R-help@stat.math.ethz.ch 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] logit link + alternatives
Just for the record -- NEWS for 2.1.0 includes: o binomial() has a new cauchit link (suggested by Roger Koenker). the MASS polr for ordered response is also now adapted for the Cauchit case. 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 On Feb 7, 2005, at 7:01 AM, (Ted Harding) wrote: On 07-Feb-05 [EMAIL PROTECTED] wrote: Help needed with lm function: Dear R's, Could anyone tell me how to replace the link function (probit logit, loglog etc.) in lm with an abitrary user-defined function? The task is to perform ML Estimation of betas for a dichotome target variable. Maybe there is already a package for this (I did not find one). Any hints or a code excerpt would be welcome! Thank you -Jeff I asked a similar question last year (2 April 2004) since I wanted a cauchy link in a binary response model (the data suggested heavy tails). I thought in the first place that I saw a fairly straightforward way to do it, but Brian Ripley's informed response put me off, once I had looked into the details of what would be involved (his reply which includes my original mail follows): # On Fri, 2 Apr 2004 [EMAIL PROTECTED] wrote: # # I am interested in extending the repertoire of link functions # in glm(Y~X, family=binomial(link=...)) to include a tan link: # # eta = (4/pi)*tan(mu) # # i.e. this link bears the same relation to the Cauchy distribution # as the probit link bears to the Gaussian. I'm interested in sage # advice about this from people who know their way aroung glm. # # From the surface, it looks as though it might just be a matter # of re-writing 'make.link' in the obvious sort of way so as to # incorporate tan, but I fear traps ... # # How are you going to do that? If you edit make.link and have your # own local copy, the namespace scoping will ensure that the system # copy gets used, and the code in binomial() will ensure that even # that does not get called except for the pre-coded list of links. # # What am I missing? # # You need a local, modified, copy of binomial, too, AFAICS. As I say, the implied details put me off for a while, but in this particular case Thomas W Yee came up with a ready-made solution (23 April 2004): # my VGAM package at www.stat.auckland.ac.nz/~yee # now has the tan link for binomialff(). # It is tan(pi*(mu-0.5)). (See his full mail in the R-help archives for April 2004 for several important details regarding this implementation). So: it would seem to be quite possible to write yor own link function, but it would take quite a bit of work and would involves re-writing at least the codes for 'make.link' and for 'binomial', and being careful about how you use them. Hoping this helps, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 07-Feb-05 Time: 12:57:07 -- XFMail -- __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] DLL hangs
Urs Wagner wrote: Hello I built a dll with cggwin. When I want to load it with RGUI the RGUI hangs. How can I troubleshoot it? Not using cygwin, which is unsupported. Please read the R for Windows FAQ, in particular Chapter 7 Building from Source and follow the advices given therein - and given in therein cited documentation such as README.packages. Uwe Ligges Thanks Urs __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] subset data.frame with value != in all columns
Petr, Thank you! Yes, rowSums appears to be even a little bit faster than unique(which()), and it also maintains the original order. I do want original order maintained, but I first apply a function to one of my data.frames (that without any -s ... yes, these do represent nulls, as someone asked earlier) and rbind these two dataframes back together, so I need to sort (by rownames) after the rbind (there doesn't seem to be a sortby option in rbind). I apologize for not jumping on rowSums earlier, I hadn't caught on that it was summing counts of occurrence of the search value, not summing the search value itself. Thanks again, this is very instructive and *very* helpful. humbly, Tim Petr Pikal [EMAIL PROTECTED] 02/07/05 02:12AM Hi Tim I can not say much about apply, but the code with unique(which()) gives you reordered rows in case of - selection try set.seed(1) in.df - data.frame( c1=rnorm(4), c2=rnorm(4), c3=rnorm(4), c4=rnorm(4), c5=rnorm(4)) in.df[in.df3] - (-) system.time(e - in.df[unique(which(in.df == -, arr.ind = TRUE)[,1]), ]) system.time(e1 - in.df[(rowSums(in.df == -)) != 0,]) all.equal(e,e1) So if you mind you need to do reordering. ooo-order(as.numeric(rownames(e))) all.equal(e[ooo,],e1) Cheers Petr On 4 Feb 2005 at 11:17, Tim Howard wrote: Because I'll be doing this on big datasets and time is important, I thought I'd time all the different approaches that were suggested on a small dataframe. The results were very instructive so I thought I'd pass them on. I also discovered that my numeric columns (e.g. -.000) weren't found by apply() but were found by which() and the simple replace. Was it apply's fault or something else? Note how much faster unique(which()) is; wow! Thanks to Marc Schwartz for this blazing solution. nrow(in.df) [1] 4 #extract rows with no - system.time(x - subset(in.df, apply(in.df, 1, function(in.df){all(in.df != -)}))) [1] 3.25 0.00 3.25 NA NA system.time(y- in.df[-unique(which(in.df == -, arr.ind = TRUE)[, 1]), ]) [1] 0.17 0.00 0.17 NA NA system.time({is.na(in.df) -in.df == -; z - na.omit(in.df)}) [1] 0.25 0.02 0.26 NA NA nrow(x);nrow(y);nrow(z) [1] 39990 [1] 39626 [1] 39626 #extract rows with - system.time(d-subset(in.df, apply(in.df, 1, function(in.df){any(in.df == -)}))) [1] 3.40 0.00 3.45 NA NA system.time(e-in.df[unique(which(in.df == -, arr.ind = TRUE)[, 1]), ]) [1] 0.11 0.00 0.11 NA NA nrow(d); nrow(e) [1] 10 [1] 374 Tim Howard Marc Schwartz [EMAIL PROTECTED] 02/03/05 03:24PM On Thu, 2005-02-03 at 14:57 -0500, Tim Howard wrote: ... snip... My questions: Is there a cleaner way to extract all rows containing a specified value? How can I extract all rows that don't have this value in any col? #create dummy dataset x - data.frame( c1=c(-99,-99,-99,4:10), c2=1:10, c3=c(1:3,-99,5:10), c4=c(10:1), c5=c(1:9,-99)) ..snip... How about this, presuming that your data frame is all numeric: For rows containing -99: x[unique(which(x == -99, arr.ind = TRUE)[, 1]), ] c1 c2 c3 c4 c5 1 -99 1 1 10 1 2 -99 2 2 9 2 3 -99 3 3 8 3 44 4 -99 7 4 10 10 10 10 1 -99 For rows not containing -99: x[-unique(which(x == -99, arr.ind = TRUE)[, 1]), ] c1 c2 c3 c4 c5 5 5 5 5 6 5 6 6 6 6 5 6 7 7 7 7 4 7 8 8 8 8 3 8 9 9 9 9 2 9 What I have done here is to use which(), setting arr.ind = TRUE. This returns the row, column indices for the matches to the boolean statement. The first column returned by which() in this case are the row numbers matching the statement, so I take the first column only. Since it is possible that more than one element in a row can match the boolean, I then use unique() to get the singular row values. Thus, I can use the returned row indices above to subset the data frame. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Petr Pikal [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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] logit link + alternatives
roger koenker rkoenker at uiuc.edu writes: : : Just for the record -- NEWS for 2.1.0 includes: : : o binomial() has a new cauchit link (suggested by Roger Koenker). : : the MASS polr for ordered response is also now adapted for the Cauchit : case. Do any of the data sets that come with R, MASS, etc. provide an example where this model is appropriate? If not, is there another publicly available data set for it? Thanks. __ R-help@stat.math.ethz.ch 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] proportional matrix rows
This works for your first example: f - function(m) { k - t(t(m) %/% m[1,]) which(rowSums(k - k[, 1]) == 0) } f(jj) [1] 1 2 8 but not the second one. The 0s are problematic... Andy From: Robin Hankin Hi I have a two-column integer matrix like this: R jj [,1] [,2] [1,] -11 [2,] -22 [3,] -76 [4,] -87 [5,] -65 [6,] -98 [7,] -54 [8,]3 -3 [9,] -109 [10,] -43 I want a diagnostic that detects whether a row is a multiple of the first row or not. In this case, this would be rows 1,2, and 8. How to do this nicely? Sometimes the first row has a zero, so the method would have to work on [,1] [,2] [1,]01 [2,]11 [3,]08 [4,]0 -4 [5,]00 [6,]40 in which case rows 1,3,4,5 are multiples. It'd be nice to have a solution that works for any number of columns. -- Robin Hankin Uncertainty Analyst Southampton Oceanography Centre European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] INFO : just one question
hi, i got just one question concerning R-Project. How can we simply include in C++ program , the r library? can we find sources of examples. Thanks for your help. Bests regards. BILLY Frédéric RESPONSABLE TECHNO ADI Tél : 01.56.88.84.44 Fax : 01.56.88.84.05 [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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] DLL hangs
On Mon, 07 Feb 2005 14:43:45 +0100, Uwe Ligges [EMAIL PROTECTED] wrote : Urs Wagner wrote: Hello I built a dll with cggwin. When I want to load it with RGUI the RGUI hangs. How can I troubleshoot it? Not using cygwin, which is unsupported. Please read the R for Windows FAQ, in particular Chapter 7 Building from Source and follow the advices given therein - and given in therein cited documentation such as README.packages. Urs: That's probably the easiest approach. However, if there really is some reason why Cygwin is necessary for you, then in principle what you are trying should be possible. It is definitely possible to write DLLs in compilers other than MinGW, such as MSVC++, Delphi, various Fortrans, etc. You can read some general advice for using foreign compilers on my web page http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/ If you can work out what is going wrong with Cygwin, I'd be happy to add a section of your findings. Duncan Murdoch __ R-help@stat.math.ethz.ch 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] DLL hangs
I would like to use pipes. The mkfifo call is not in the mingw distribution that I am using. Urs Uwe Ligges wrote: Urs Wagner wrote: Hello I built a dll with cggwin. When I want to load it with RGUI the RGUI hangs. How can I troubleshoot it? Not using cygwin, which is unsupported. Please read the R for Windows FAQ, in particular Chapter 7 Building from Source and follow the advices given therein - and given in therein cited documentation such as README.packages. Uwe Ligges Thanks Urs __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] Programming/scripting with expressions - variables
Here is one way. It is the custom to return a value that will be assigned to the variable, so I changed your 'macro' to a function that returns the value and then assigns it to your variable: test - function(name, value){ + .result - NULL # initialize to NULL + .result[name] - value + .result[paste('other_', name, sep='')] - paste(other_, value, sep='') + .result + } Gregor - test('Gorjanc', '25') Gregor# print out the vector Gorjanc other_Gorjanc 25other_25 __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Office of Technology, Convergys [EMAIL PROTECTED] +1 (513) 723-2929 Gorjanc Gregor [EMAIL PROTECTED]To: r-help@stat.math.ethz.ch uni-lj.si cc: Sent by: Subject: [R] Programming/scripting with expressions - variables [EMAIL PROTECTED] ath.ethz.ch 02/07/2005 09:52 Hello to Rusers! I am puzzled with R and I really do not know where to look in for my problem. I am moving from SAS and I have difficulties in translating SAS to R world. I hope I will get some hints or pointers so I can study from there on. I would like to do something like this. In SAS I can write a macro as example bellow, which is afcourse a silly one but shows what I don't know how to do in R. %macro test(data, colname, colvalue); data data; ... colname=colvalue; other_colname=other_colvalue; run; %mend; And if I run it with this call: %test(Gregor, Gorjanc, 25); I get a table with name 'Gregor' and columns 'Gorjanc', and 'other_Gorjanc' with values: Gorjanc other_Gorjanc 25other_25 So can one show me the way to do the same thing in R? Thanks! -- Lep pozdrav / With regards, Gregor GORJANC --- University of Ljubljana Biotechnical Faculty URI: http://www.bfro.uni-lj.si Zootechnical Departmentemail: gregor.gorjanc at bfro.uni-lj.si Groblje 3 tel: +386 (0)1 72 17 861 SI-1230 Domzalefax: +386 (0)1 72 17 888 Slovenia __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] R1.5.O
How can I download the R1.5.O version for windows with its extend packages Splancs 1.5.0 and Spatial 1.5.0? - mails ! [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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] Creating a correlation Matrix
Hi all: I have a question on how to go about creating a correlation matrix. I have a huge amount of data21 variables for 3471 times. I want to see how each of the variables correlate to each other. Any help would be appreciated, including which package and which functions I should use to do this. Thanks, Jessica Higgs Masters Student Department of Meteorology Penn State University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] problem with logistic regression
Hi, we try to do a logistic regression with the function glm. But we notice that this function don't give the same results as the SAS proc catmod (differents estimate given). We try to change the contrast on R system with: options(contrasts=c(unordered=contr.SAS,ordered=contr.poly)) We also try with brlr and logistf functions. Unfortunately, the estimate aren't still the same. Please could someone help us. Thank you -- This mail sent through Polytech'Lille WebMail (IMP) __ R-help@stat.math.ethz.ch 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] Rmatlab
On Mon, 7 Feb 2005, David Enot wrote: I came across recently to the Rmatlab package (http://www.omegahat.org/RMatlab/) that allows R and Matlab to talk to each other. I made several attempts to install it on my Mac but without any success as some headers seem to miss. I am just wondering if anyone has already tried and successfully used RMatlab. According to the website, this should run on unix machines and I was surprised that it couldn't be true for Mac as the OS X, Linux and Unix MATLAB architectures are pretty much similar. Pretend we can't see your screen and include the error messages in your post. Can we assume you are running 10.3.7 and have XCode 1.5 loaded as well? -- SIGSIG -- signature too long (core dumped) __ R-help@stat.math.ethz.ch 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] Creating a correlation Matrix
Have you considered cor? The command 'help.search(correlation)' suggests among other functions var(stats), the documentation for which also includes cor. If this is not adequate, PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html . It may help you get more useful replies in the future. spencer graves Jessica Higgs wrote: Hi all: I have a question on how to go about creating a correlation matrix. I have a huge amount of data21 variables for 3471 times. I want to see how each of the variables correlate to each other. Any help would be appreciated, including which package and which functions I should use to do this. Thanks, Jessica Higgs Masters Student Department of Meteorology Penn State University __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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: Creating a correlation Matrix
Hi, see ?cor in base package to get correlation matrix for your data. Maybe it could be usefull getting principal components (give a look to: ? princomp (base)) to reduce the number of variables. Hoping I helped you. Best regards, Vito You wrote: Hi all: I have a question on how to go about creating a correlation matrix. I have a huge amount of data21 variables for 3471 times. I want to see how each of the variables correlate to each other. Any help would be appreciated, including which package and which functions I should use to do this. Thanks, Jessica Higgs Masters Student Department of Meteorology Penn State University = Diventare costruttori di soluzioni Became solutions' constructors The business of the statistician is to catalyze the scientific learning process. George E. P. Box Top 10 reasons to become a Statistician 1. Deviation is considered normal 2. We feel complete and sufficient 3. We are 'mean' lovers 4. Statisticians do it discretely and continuously 5. We are right 95% of the time 6. We can legally comment on someone's posterior distribution 7. We may not be normal, but we are transformable 8. We never have to say we are certain 9. We are honestly significantly different 10. No one wants our jobs Visitate il portale http://www.modugno.it/ e in particolare la sezione su Palese http://www.modugno.it/archivio/palese/ __ R-help@stat.math.ethz.ch 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] Creating a correlation Matrix
From the help for cor (from the stats package): If x and y are matrices then the covariances (or correlations) between the columns of x and the columns of y are computed. So if you make a matrix with each column corresponding to one of your variables, you can get what you're after. For future reference, help.search(correlation) turns up the proper page as the first suggestion. Hope this helps, Matt Wiener -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jessica Higgs Sent: Monday, February 07, 2005 10:58 AM To: R-help@stat.math.ethz.ch Subject: [R] Creating a correlation Matrix Hi all: I have a question on how to go about creating a correlation matrix. I have a huge amount of data21 variables for 3471 times. I want to see how each of the variables correlate to each other. Any help would be appreciated, including which package and which functions I should use to do this. Thanks, Jessica Higgs Masters Student Department of Meteorology Penn State University __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] proportional matrix rows
Gabor Grothendieck [EMAIL PROTECTED] writes: Robin Hankin r.hankin at soc.soton.ac.uk writes: : : Hi : : I have a two-column integer matrix like this: : : R jj : :[,1] [,2] : [1,] -11 : [2,] -22 : [3,] -76 : [4,] -87 : [5,] -65 : [6,] -98 : [7,] -54 : [8,]3 -3 : [9,] -109 : [10,] -43 : : I want a diagnostic that detects whether a row is a multiple of : the first row or not. In this case, this would be rows 1,2, and 8. : : How to do this nicely? Sometimes the first row has a zero, so the : method would have to work on : : [,1] [,2] : [1,]01 : [2,]11 : [3,]08 : [4,]0 -4 : [5,]00 : [6,]40 : : : in which case rows 1,3,4,5 are multiples. It'd be nice to have : a solution that works for any number of columns. If rowi is a multiple of row1 then crossprod(cbind(row1, rowi)) is singular so: apply(mat, 1, function(x) det(crossprod(cbind(x, mat[1,] == 0 If your matrix only has two columns then crossprod(x) is singular iff x is so you can eliminate the crossprod. ..and in that case it might be easier just to calculate the dot product with the orthogonal of mat[1,]: z - jj[1,] jj %*% c(z[1], -z[2]) [,1] [1,]0 [2,]0 [3,]1 [4,]1 [5,]1 [6,]1 [7,]1 [8,]0 [9,]1 [10,]1 (Notice that the value 1 just comes from Robin being singularly bad at selecting arbitrary rows that are not proportional to the first one!) This generalizes to more than two columns as jj %*% (diag(ncol(jj)) - z%*%solve(crossprod(z))%*%t(z)) having rows that are identically zero (the multiplier matrix is obviously rank-deficient so you can leave out one column, but you need to guard against leaving in a column of zeroes, so it is hardly worth it). In all cases you probably need some sort of guard against round-off. I.e. something like rowSums(zapsmall(jj %*% (diag(2) - z%*%solve(crossprod(z),t(z^2) == 0 [1] TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE or rowSums((jj %*% (diag(2) - z%*%solve(crossprod(z),t(z^2) 1e-7 [1] TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] problem with logistic regression
CATMOD in SAS builds log-linear glms. If you are truly trying to create logistic regressions in SAS, use PROC LOGISTIC instead. If you really meant that you are trying to create log-linear models in R - then look up the usage of the function loglin (e.g. loglin()) Cheers, Joe Quoting [EMAIL PROTECTED]: Hi, we try to do a logistic regression with the function glm. But we notice that this function don't give the same results as the SAS proc catmod (differents estimate given). We try to change the contrast on R system with: options(contrasts=c(unordered=contr.SAS,ordered=contr.poly)) We also try with brlr and logistf functions. Unfortunately, the estimate aren't still the same. Please could someone help us. Thank you -- This mail sent through Polytech'Lille WebMail (IMP) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Joseph J. Nocera Ph.D. Candidate NB Coop. Fish Wildlife Research Unit Biology Department - Univ. New Brunswick Fredericton, NB Canada E3B 6E1 tel: (902) 679-5733 Why does it have to be spiders? Why can't it be 'follow the butterflies'?! Ron Weasley, Harry Potter The Chamber of Secrets __ R-help@stat.math.ethz.ch 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] Creating a correlation Matrix
Le 07.02.2005 16:58, Jessica Higgs a écrit : Hi all: I have a question on how to go about creating a correlation matrix. I have a huge amount of data21 variables for 3471 times. I want to see how each of the variables correlate to each other. Any help would be appreciated, including which package and which functions I should use to do this. Hello, that is not that huge and what is wrong with ?cor A - matrix(rnorm(21*3471),ncol=21) #you should replace A by your data matcor - cor(A) #that is your correlation matrix image(matcor) # and how to watch it heatmap(matcor) # an other way to watch it Hope this helps. Romain -- Romain FRANCOIS : [EMAIL PROTECTED] page web : http://addictedtor.free.fr/ (en construction) 06 18 39 14 69 / 01 46 80 65 60 ___ Etudiant en 3eme année Institut de Statistique de l'Université de Paris (ISUP) Filière Industrie et Services http://www.isup.cicrp.jussieu.fr/ __ R-help@stat.math.ethz.ch 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] Help with multicomarisons after ANCOVA
Dear All, I' ve used ANCOVA (through lm(Y~factor*x)) to study the influence/differences between levels of factor upon the Y-x relationship. I found that both intercepts and slopes differ among levels of the factor. I understand from the results of summary(lm(Y~factor*x)) which of the intercepts/slopes per level differ from the reference level. I later used lm(Y~factor/(1+x)-1) to obtain explicit coefficients per level. My question is: Can I test for differences among all intercepts and /or slopes per levels using simtest (from package multicomp) as summary (simtest(Y~factor+x,type=tukey))? The outputs seem to contradict the results from the explicit coefficients approach! Thanks in advance, Eduardo __ R-help@stat.math.ethz.ch 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] proportional matrix rows
Robin The attached script works but it ain't pretty/ Martin -- No virus found in this outgoing message. Checked by AVG Anti-Virus. __ R-help@stat.math.ethz.ch 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] Creating a correlation Matrix
I've tried using cor() by the following sequence: C - cor(x, y = NULL, use = all.obs, method = c(pearson)) where x is my matrix of 21 columns and 3471 rows. and I get this error: Error in cor(x, y = NULL, use = all.obs, method = c(pearson)) : missing observations in cov/cor any suggestions? At 08:32 AM 2/7/2005 -0800, Spencer Graves wrote: Have you considered cor? The command 'help.search(correlation)' suggests among other functions var(stats), the documentation for which also includes cor. If this is not adequate, PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html . It may help you get more useful replies in the future. spencer graves Jessica Higgs wrote: Hi all: I have a question on how to go about creating a correlation matrix. I have a huge amount of data21 variables for 3471 times. I want to see how each of the variables correlate to each other. Any help would be appreciated, including which package and which functions I should use to do this. Thanks, Jessica Higgs Masters Student Department of Meteorology Penn State University __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] Creating a correlation Matrix
Jessica Higgs wrote: I've tried using cor() by the following sequence: C - cor(x, y = NULL, use = all.obs, method = c(pearson)) where x is my matrix of 21 columns and 3471 rows. and I get this error: Error in cor(x, y = NULL, use = all.obs, method = c(pearson)) : missing observations in cov/cor any suggestions? Reading ?cor would have given you a solution: Quoting from ?cor If 'use' is 'all.obs', then the presence of missing observations will produce an error. If 'use' is 'complete.obs' then missing values are handled by casewise deletion. Finally, if 'use' has the value 'pairwise.complete.obs' then the correlation between each pair of variables is computed using all complete pairs of observations on those variables. This can result in covariance or correlation matrices which are not positive semidefinite. You have missing values in your data and with your usage of cor and argument use = all.obs precludes this. Choose another value for use, noting the advice in the help pages for cor. G At 08:32 AM 2/7/2005 -0800, Spencer Graves wrote: Have you considered cor? The command 'help.search(correlation)' suggests among other functions var(stats), the documentation for which also includes cor. If this is not adequate, PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html . It may help you get more useful replies in the future. spencer graves Jessica Higgs wrote: Hi all: I have a question on how to go about creating a correlation matrix. I have a huge amount of data21 variables for 3471 times. I want to see how each of the variables correlate to each other. Any help would be appreciated, including which package and which functions I should use to do this. Thanks, Jessica Higgs Masters Student Department of Meteorology Penn State University -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Gavin Simpson [T] +44 (0)20 7679 5522 ENSIS Research Fellow [F] +44 (0)20 7679 7565 ENSIS Ltd. ECRC [E] gavin.simpsonATNOSPAMucl.ac.uk UCL Department of Geography [W] http://www.ucl.ac.uk/~ucfagls/cv/ 26 Bedford Way[W] http://www.ucl.ac.uk/~ucfagls/ London. WC1H 0AP. %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% __ R-help@stat.math.ethz.ch 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] Creating a correlation Matrix
Le 07.02.2005 18:53, Jessica Higgs a écrit : I've tried using cor() by the following sequence: C - cor(x, y = NULL, use = all.obs, method = c(pearson)) In ?cor you find that : If 'use' is 'all.obs', then the presence of missing observations will produce an error. try use=complete instead. Romain. where x is my matrix of 21 columns and 3471 rows. and I get this error: Error in cor(x, y = NULL, use = all.obs, method = c(pearson)) : missing observations in cov/cor any suggestions? At 08:32 AM 2/7/2005 -0800, Spencer Graves wrote: Have you considered cor? The command 'help.search(correlation)' suggests among other functions var(stats), the documentation for which also includes cor. If this is not adequate, PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html . It may help you get more useful replies in the future. spencer graves Jessica Higgs wrote: Hi all: I have a question on how to go about creating a correlation matrix. I have a huge amount of data21 variables for 3471 times. I want to see how each of the variables correlate to each other. Any help would be appreciated, including which package and which functions I should use to do this. Thanks, Jessica Higgs Masters Student Department of Meteorology Penn State University __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Romain FRANCOIS : [EMAIL PROTECTED] page web : http://addictedtor.free.fr/ (en construction) 06 18 39 14 69 / 01 46 80 65 60 ___ Etudiant en 3eme année Institut de Statistique de l'Université de Paris (ISUP) Filière Industrie et Services http://www.isup.cicrp.jussieu.fr/ __ R-help@stat.math.ethz.ch 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] Creating a correlation Matrix
It looks like you have missing observations. With the use argument, you can specify complete observations or pairwise-complete observations. Hope this helps, Matt Wiener -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jessica Higgs Sent: Monday, February 07, 2005 12:54 PM To: Spencer Graves; R-help@stat.math.ethz.ch Subject: Re: [R] Creating a correlation Matrix I've tried using cor() by the following sequence: C - cor(x, y = NULL, use = all.obs, method = c(pearson)) where x is my matrix of 21 columns and 3471 rows. and I get this error: Error in cor(x, y = NULL, use = all.obs, method = c(pearson)) : missing observations in cov/cor any suggestions? At 08:32 AM 2/7/2005 -0800, Spencer Graves wrote: Have you considered cor? The command 'help.search(correlation)' suggests among other functions var(stats), the documentation for which also includes cor. If this is not adequate, PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html . It may help you get more useful replies in the future. spencer graves Jessica Higgs wrote: Hi all: I have a question on how to go about creating a correlation matrix. I have a huge amount of data21 variables for 3471 times. I want to see how each of the variables correlate to each other. Any help would be appreciated, including which package and which functions I should use to do this. Thanks, Jessica Higgs Masters Student Department of Meteorology Penn State University __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] problem with logistic regression
Helene, The problem is not with R, but with the specification of the SAS procedure you used. It would be simpler and more comparable if you specify your model in SAS with Proc Logistic or Proc Genmod. See if they work out for you, Tim Original message Date: Mon, 7 Feb 2005 17:19:54 +0100 From: [EMAIL PROTECTED] Subject: [R] problem with logistic regression To: r-help@stat.math.ethz.ch Cc: [EMAIL PROTECTED] Hi, we try to do a logistic regression with the function glm. But we notice that this function don't give the same results as the SAS proc catmod (differents estimate given). We try to change the contrast on R system with: options(contrasts=c(unordered=contr.SAS,ordered=contr.poly)) We also try with brlr and logistf functions. Unfortunately, the estimate aren't still the same. Please could someone help us. Thank you -- This mail sent through Polytech'Lille WebMail (IMP) __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] proportional matrix rows - with attachment
Sorry! Something went wrong with the attachment in my previous post. Here it is. --- intmult - function(X) { # extract columns with non-zero top cell X1 - X[,which(X[1,]!=0)] # look for integer multiples in reduced table m - nrow(X1);n - ncol(X1) D - matrix(X1[1,],m,n,byrow=T) X2 - X1/D ind - which(rowSums(X2==rowMeans(X2))==n) # build new table of integer multiples X3 - X[ind,] # remove rows that contain non-zero(s) below top zero ind - which(X3[1,]==0) lind = length(ind) temp - X3[,ind]==0 ind2 - which(rowSums(temp)==lind) X4 - X3[ind2,] } -- No virus found in this outgoing message. Checked by AVG Anti-Virus. __ R-help@stat.math.ethz.ch 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] Programming/scripting with expressions - variables
Gorjanc Gregor wrote: Hello to Rusers! I am puzzled with R and I really do not know where to look in for my problem. I am moving from SAS and I have difficulties in translating SAS to R world. I hope I will get some hints or pointers so I can study from there on. I would like to do something like this. In SAS I can write a macro as example bellow, which is afcourse a silly one but shows what I don't know how to do in R. %macro test(data, colname, colvalue); data data; ... colname=colvalue; other_colname=other_colvalue; run; %mend; And if I run it with this call: %test(Gregor, Gorjanc, 25); I get a table with name 'Gregor' and columns 'Gorjanc', and 'other_Gorjanc' with values: Gorjanc other_Gorjanc 25other_25 So can one show me the way to do the same thing in R? Thanks! -- Lep pozdrav / With regards, Gregor GORJANC Greetings, Gregor, from a fan of Slovenia. Here is a start. Multiple variables are often put together in data frames. Your example did not include an input dataset name. I took data to be an input data frame, and added two new variables. I assume that colvalue and colname are character values. If colvalue has length one it will be duplicated for each row of data. test - function(data, colname, colvalue) { data[[colname]] - colvalue data[[paste('other',colname,sep='_')]] - paste('other',colvalue,sep='_') data } Example usage: data - data.frame(x=1:5, y=11:15) data2 - test(data, 'a', 'b') data - test(data, 'a', 'b') # over-write test(data, 'a', 'b') # create data but don't store with(test(data, ),{...})# reference variables in temporary dataset If we know what your ultimate goal is, there may be a much better approach than the test function. In many cases, you do not need to create new variables at all. Franc -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ R-help@stat.math.ethz.ch 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] install RMySQL
Hi, I've got a Dual G5 running 10.3.7 and I'm trying to install RMySQL. I've already got R up and running. When I try the command install.packages(RMySQL) It downloads a few things and then produces the following error: --- Configuration error: Could not locate the library libz required by MySQL. INSTRUCTIONS: The libz library is required by the MySQL client library in order to compress/uncompress connections between clients and the MySQL engine. Make sure you have libz installed properly and/or included in your $LD_LIBRARY_PATH. Perhaps it is not in any of the standard directories (e.g., /usr/lib/, /usr/local/lib)? Aborting the installation of RMySQL. ERROR: configuration failed for package 'RMySQL' However, if I check for libz I get: capabilities(libz) libz TRUE I'm not sure what the problem is because R is telling me that it doesn't know where libz is, but then it's also telling me it does know where libz is. Has anyone else seen this problem or know how I can get RMySQL installed on my machine? Just as an added note I know that install.packages works because install.packages(DBI) worked without a problem. Thanks again. -Xander __ R-help@stat.math.ethz.ch 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] install RMySQL
R comes with it's own copy of zlib so even if it is compiled into R, there isn't necessarily a system-wide installation of the library. You may still need to install it. -roger Xander Meadow wrote: Hi, I've got a Dual G5 running 10.3.7 and I'm trying to install RMySQL. I've already got R up and running. When I try the command install.packages(RMySQL) It downloads a few things and then produces the following error: --- Configuration error: Could not locate the library libz required by MySQL. INSTRUCTIONS: The libz library is required by the MySQL client library in order to compress/uncompress connections between clients and the MySQL engine. Make sure you have libz installed properly and/or included in your $LD_LIBRARY_PATH. Perhaps it is not in any of the standard directories (e.g., /usr/lib/, /usr/local/lib)? Aborting the installation of RMySQL. ERROR: configuration failed for package 'RMySQL' However, if I check for libz I get: capabilities(libz) libz TRUE I'm not sure what the problem is because R is telling me that it doesn't know where libz is, but then it's also telling me it does know where libz is. Has anyone else seen this problem or know how I can get RMySQL installed on my machine? Just as an added note I know that install.packages works because install.packages(DBI) worked without a problem. Thanks again. -Xander __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Roger D. Peng http://www.biostat.jhsph.edu/~rpeng/ __ R-help@stat.math.ethz.ch 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] install RMySQL
Hi, Thank you for responding. One thing I forgot to mention (although I'm guessing you figured it out anyway) is that I'm running Mac OS X. I checked and I've got the file /usr/include/zlib.h installed on my machine. Is this enough for R or does it need a more robust installation of zlib? If this is enough, how do I let R know about the zlib.h file. If it's not, where should I get the correct zlib from? Thank you for any and all responses. -Xander On Mon, 2005-02-07 at 13:43, Roger D. Peng wrote: R comes with it's own copy of zlib so even if it is compiled into R, there isn't necessarily a system-wide installation of the library. You may still need to install it. -roger Xander Meadow wrote: Hi, I've got a Dual G5 running 10.3.7 and I'm trying to install RMySQL. I've already got R up and running. When I try the command install.packages(RMySQL) It downloads a few things and then produces the following error: --- Configuration error: Could not locate the library libz required by MySQL. INSTRUCTIONS: The libz library is required by the MySQL client library in order to compress/uncompress connections between clients and the MySQL engine. Make sure you have libz installed properly and/or included in your $LD_LIBRARY_PATH. Perhaps it is not in any of the standard directories (e.g., /usr/lib/, /usr/local/lib)? Aborting the installation of RMySQL. ERROR: configuration failed for package 'RMySQL' However, if I check for libz I get: capabilities(libz) libz TRUE I'm not sure what the problem is because R is telling me that it doesn't know where libz is, but then it's also telling me it does know where libz is. Has anyone else seen this problem or know how I can get RMySQL installed on my machine? Just as an added note I know that install.packages works because install.packages(DBI) worked without a problem. Thanks again. -Xander __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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 on Beowulf cluster?
Dear R-help, Has anyone tried running R on a Beowulf-type cluster? I can get R to run in batch (using R CMD BATCH) on a cluster, but am wondering if it is possible to get an interactive R session on a compute node. Right now, if I run: beorun --nolocal R I just get the R start-up message and back to the shell prompt. If I try bpsh 0 R I can get R started (but the R prompt does not appear) and do computations, but no access to an x11() device. I'd very much appreciate any pointer. Best, Andy Andy Liaw, PhD Biometrics Research PO Box 2000, RY33-300 Merck Research Labs Rahway, NJ 07065 andy_liaw at merck.com 732-594-0820 __ R-help@stat.math.ethz.ch 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 on Beowulf cluster?
look into the following knot of CRAN packages: SNOW Rmpi Rpvm rlecuyer rsprng SNOW-FT RScaLAPACK et cetera. these provide some pretty interesting bits - like a suite of parallelized apply() functions. --elijah Has anyone tried running R on a Beowulf-type cluster? I can get R to run in batch (using R CMD BATCH) on a cluster, but am wondering if it is possible to get an interactive R session on a compute node. Right now, if I run: beorun --nolocal R I just get the R start-up message and back to the shell prompt. If I try bpsh 0 R I can get R started (but the R prompt does not appear) and do computations, but no access to an x11() device. I'd very much appreciate any pointer. Best, Andy Andy Liaw, PhD Biometrics Research PO Box 2000, RY33-300 Merck Research Labs Rahway, NJ 07065 andy_liaw at merck.com 732-594-0820 __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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 on Beowulf cluster?
Hi Elijah, Thanks for the reply. I'm aware of almost all of those things you mentioned, and have played with some of them. I'm not looking to do distributed computing within R at this point. What I'm after, though, is not really addressed by any of them. I want a user to be able to start an interactive R session on a compute node that the system determines (dynamically) to be most available at the time. That's what `beorun' does, but I couldn't get it to run R interactively. Cheers, Andy From: elijah wright look into the following knot of CRAN packages: SNOW Rmpi Rpvm rlecuyer rsprng SNOW-FT RScaLAPACK et cetera. these provide some pretty interesting bits - like a suite of parallelized apply() functions. --elijah Has anyone tried running R on a Beowulf-type cluster? I can get R to run in batch (using R CMD BATCH) on a cluster, but am wondering if it is possible to get an interactive R session on a compute node. Right now, if I run: beorun --nolocal R I just get the R start-up message and back to the shell prompt. If I try bpsh 0 R I can get R started (but the R prompt does not appear) and do computations, but no access to an x11() device. I'd very much appreciate any pointer. Best, Andy Andy Liaw, PhD Biometrics Research PO Box 2000, RY33-300 Merck Research Labs Rahway, NJ 07065 andy_liaw at merck.com 732-594-0820 __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] Need your help with my R plot
Hi, I am using R to plot the graph and the problem I am facing with my graph is that I have lots of points concentrated in one area and It is creating a visualization challenge. Is there any commands in R I could use to solve this problem. Even if there is no command, do you know how I could tackle this problem...(I want to separate these points so I could see each of them...) Any help is much appreciated... Thank you kindly Latha __ R-help@stat.math.ethz.ch 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-DCOM server problem.
R-DCOM server problem My program (VB program) runs R-program through R DCOM server. No problem to run statistical functions and my own functions. However When I tried to load data using ODBC I got an error message. I need to set up any parameter for R-DCOM server for ODBC ? library(DBI); library(RODBC); con = odbcConnect(odbc_db_string, uid = uid, pwd=pwd); tlist = sqlQuery(con, select tname from source_tab); --- Error message --- An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in matcher.exe Additional information: Object is static; operation not allowed Tae Sik Han. North Carolina State University. __ R-help@stat.math.ethz.ch 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] ROracle problem.
ROracle ploblem I can't install ROracle in the window XP. Is there any way to install ROracle package on the windows OS ? I think I can enhance data acquisition performance using oracle native dirver instead of using ODBC. Tae Sik Han. North Carolina State University. __ R-help@stat.math.ethz.ch 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] Need your help with my R plot
On Mon, 7 Feb 2005, Latha Raja wrote: I am using R to plot the graph and the problem I am facing with my graph is that I have lots of points concentrated in one area and It is creating a visualization challenge. How about 'plot( ,pch='.', )? -- Robert Burrows, PhD New England Biometrics [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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 or weka
Hi, guys: These days I keep using R and Weka to do data mining. I think my next step is open the source codes so that I can customrize them and make them better server my purpose. But now I kinda hesitate to do so b/c I am really not sure which is better to start with. You know, both require some time and I cannot clone myself to work on both:) If here are some persons who used both of them, please provide some suggestions from your experience. Thanks, Ed __ R-help@stat.math.ethz.ch 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] Need your help with my R plot
Latha Raja wrote: Hi, I am using R to plot the graph and the problem I am facing with my graph is that I have lots of points concentrated in one area and It is creating a visualization challenge. Is there any commands in R I could use to solve this problem. Even if there is no command, do you know how I could tackle this problem...(I want to separate these points so I could see each of them...) Any help is much appreciated... Thank you kindly Latha __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Hi, Take a look at the function: ixyplot in the package IDPmisc. Eryk -- Dipl. bio-chem. Witold Eryk Wolski MPI-Moleculare Genetic Ihnestrasse 63-73 14195 Berlin tel: 0049-30-83875219 __(_ http://www.molgen.mpg.de/~wolski \__/'v' http://r4proteomics.sourceforge.net||/ \ mail: [EMAIL PROTECTED]^^ m m [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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] THANK YOU:-)
Thank you all for your help :-) Much Much Aprreciated I tried with the jitter command and it worked :-) Cheers, Latha -Original Message- From: Latha Raja Sent: Monday, February 07, 2005 3:21 PM To: 'r-help@stat.math.ethz.ch' Subject: Need your help with my R plot Importance: High Hi, I am using R to plot the graph and the problem I am facing with my graph is that I have lots of points concentrated in one area and It is creating a visualization challenge. Is there any commands in R I could use to solve this problem. Even if there is no command, do you know how I could tackle this problem...(I want to separate these points so I could see each of them...) Any help is much appreciated... Thank you kindly Latha __ R-help@stat.math.ethz.ch 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] THANK YOU:-)
Glad that jitter() solved your problem. However, this would not be the case for largeish bivariate displays in general. So may I add another suggestion for those who might face similar problems: hexbin() in the hexbin package on Bioconductor, which was specifically developed for the problem you initially described. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning process. - George E. P. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Latha Raja Sent: Monday, February 07, 2005 1:10 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Subject: [R] THANK YOU:-) Thank you all for your help :-) Much Much Aprreciated I tried with the jitter command and it worked :-) Cheers, Latha -Original Message- From: Latha Raja Sent: Monday, February 07, 2005 3:21 PM To: 'r-help@stat.math.ethz.ch' Subject:Need your help with my R plot Importance: High Hi, I am using R to plot the graph and the problem I am facing with my graph is that I have lots of points concentrated in one area and It is creating a visualization challenge. Is there any commands in R I could use to solve this problem. Even if there is no command, do you know how I could tackle this problem...(I want to separate these points so I could see each of them...) Any help is much appreciated... Thank you kindly Latha __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] Lecture
Oi Bernardo Maybe it would also be useful to show them some of the libraries available for medical research. That list would also be useful for other people on this forum including myself ;) In the past I have made demos running R and other commercial software side by side, to demonstrate that you can do the same things and even better using R (i.e. try examples using SAS Proc Mixed vs. lme, different plots, etc) Cheers Francisco From: Uwe Ligges [EMAIL PROTECTED] To: Bernardo Rangel Tura [EMAIL PROTECTED] CC: r-help@stat.math.ethz.ch Subject: Re: [R] Lecture Date: Sun, 06 Feb 2005 22:16:10 +0100 Bernardo Rangel Tura wrote: Hi R-masters! I you receive an invitation to make a lecture about R in Medical School of Federal University of Rio de Janeiro. The goal of the lecture is to stimulate the use of R instead of others statiscal software in the Medical School. It would like to hear tour suggestions on which topics to present in the lecture. I'd rather focus on R. ;-) A subset of typical stuff for advertisements: - The language and its capabilities + from the language point of view + huge number of statistical methods implemented + outstanding graphical capabilities - GPL/Open Source - packages - for a medical school Bioconductor might be of high relevance Uwe Ligges Thanks in advance Bernardo Rangel Tura, MD, MSc National Institute of Cardiology Laranjeiras Rio de Janeiro Brazil __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] MLE: Question
Hi R users! I have a likelihood ratio statistic that depends on a parameter delta and I am trying to get confidence intervals for this delta using the fact that the likelihood ratio statistic is approx. chi-squared distributed. For this I need to maximize the two likelihoods (for the ratio statistic) one of which depends on delta too and I am trying to use the function mle. But delta is neither a parameter I would like to estimate nor a fixed value that I know the value of (to give it to the mle function with fixed=list(delta=?)). Can I still use mle to find the likelihood of the data (just denoting delta as a constant)? Thank you. Hadassa __ R-help@stat.math.ethz.ch 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] Nonparametric Split-Plot
Hello, I have several data sets involving repeated measures over time of annual grass survival in plots following application of several levels of herbicide treatments. Since the data set contains quite a number of zeros, it doesn't fit the assumptions for parametric analysis. I read in Shah, D.A. and L. V. Madden. 2004. Nonparametric analysis of ordinal data in designed factorial experiments. Am. Phytopathological Soc. 94:1 pp 33-43. that free macros exist for this analysis in SAS and R. I've looked through the R packages and searched the R mailing list; however, I can't seem to find what I'm looking for. Perhaps, I'm looking in the wrong place. I would appreciate it if someone would point me in the right direction. Thanks, Gary Whysong Department of Applied Biological Sciences Arizona State University East __ R-help@stat.math.ethz.ch 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] MLE: Question
[EMAIL PROTECTED] writes: Hi R users! I have a likelihood ratio statistic that depends on a parameter delta and I am trying to get confidence intervals for this delta using the fact that the likelihood ratio statistic is approx. chi-squared distributed. For this I need to maximize the two likelihoods (for the ratio statistic) one of which depends on delta too and I am trying to use the function mle. But delta is neither a parameter I would like to estimate nor a fixed value that I know the value of (to give it to the mle function with fixed=list(delta=?)). Can I still use mle to find the likelihood of the data (just denoting delta as a constant)? Er, ... Why wouldn't delta be a parameter?? If you consider the likelihood a function of delta and all the other parameters in the model can you not maximize it and profile over delta? -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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] Contour plot
Hello, I would like to make a contourplot of the following data; x - 1:10 y - 1:10 z - 100:110 By doing contour(x,y,z) I get the following error; Error in contour.default(x, y, z) : no proper `z' matrix specified How do I fix this?? Kind regards, Datius Blaszijk [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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] Manova mult. comparisons?
Hi R folks, I'm using Manova to evlaluate the effects of a prescribed fire treatment on some forest stand structure data MODEL - manova(Y ~ FIRE, test = Hotelling-Lawley) where Y is a 2 parameters describing tree distributions and fire has 4 levels, 0,1,2,3. Can anybody tell me how I can compare differences between individual treatments? I can't find anything in ?multcomp or ?summary.manova. I've used Tukey and Bonferonni in the past for univariate analyses, but not MANOVA. If anyone can point me to a help file I've missed or location for some useful code, I'd appreciate it. Thanks in advance, Zack __ R-help@stat.math.ethz.ch 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] Contour plot
On Tue, 8 Feb 2005 01:15:06 +0100 [EMAIL PROTECTED] wrote: Hello, I would like to make a contourplot of the following data; x - 1:10 y - 1:10 z - 100:110 By doing contour(x,y,z) I get the following error; Error in contour.default(x, y, z) : no proper `z' matrix specified How do I fix this?? x and y specify a grid and thus z must provide a value for each combination of the x's and y's! For example: x - y - 1:10 contour(x, y, outer(x, y)) Also look at outer(x, y) and read ?contour. Z Kind regards, Datius Blaszijk [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] RE: Reading Dates in a csv File
Hi all. Thanks for all of your help/suggestions. I found an old email in the R-help archives, pieced together a couple things and arrived at the solution below. As an additional followup, I thought I would go ahead and post it should other readers come across this same situation. Here goes.. Raw data: MHK,76.53,05/21/2004,5/4/2004 4:00:00 PM,60 MHK,76.53,06/21/2004,5/5/2004 4:00:00 PM,60 MHK,76.53,07/21/2004,5/6/2004 4:00:00 PM,65 MHK,76.53,08/21/2004,5/7/2004 4:00:00 PM,65 MHK,76.53,09/21/2004,5/8/2004 4:00:00 PM,70 Code: read_file - function(file,nrows=-1) { # create temp classes setClass(t_class_,representation(character)) setAs(character, t_class_, function(from) as.POSIXct(strptime(from,format=%m/%d/%Y))) setClass(t_class2_, representation(character)) setAs(character, t_class2_, function(from) as.POSIXct(strptime(from,format=%m/%d/%Y %I:%M:%S %p))) # read the file file - read.csv(file, header=FALSE, comment.char = , nrows=nrows, as.is=FALSE, col.names=c(c_field_1, n_field_2, d_field_3, d_field_4, n_field_5), colClasses=c(character, numeric, t_class_, t_class2_, numeric) ) # remove them now that we are done with them removeClass(t_class_) removeClass(t_class2_) return(file) } If any of you folks know a better way and/or have comments/enhancements to this code, feel free to post/email your critique. Thanks, Charles _ From: Charles and Kimberly Maner [mailto:[EMAIL PROTECTED] Sent: Thursday, February 03, 2005 8:35 AM To: 'r-help@stat.math.ethz.ch' Subject: Reading Dates in a csv File Hi all. I'm reading in a flat, comma-delimited flat file using read.csv. It works marvelously for the most part. I am using the colClasses argument to, basically, create numeric, factor and character classes for the columns I'm reading in. However, a couple of the fields in the file are date fields. I'm fully aware that POSIXct can be used as a class, however the field must obey, (I think), the standard/default POSIXct format. Hence the following question: Does anyone have a method they can share to read in a non-standard formatted date to convert to POSIXct? I can read it in then convert it, but that's a two pass approach and not as elegant as a single pass through read.csv. I've read, from the documentation, that [o]therwise there needs to be an as method (from package methods) for conversion from character to the specified formal class but I do not know and have not figured out how to do that. Any suggestion(s) would be greatly appreciated. Thanks, Charles [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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] Strange parsing behavior of an else condition
Dear R users, can anybody explain the reason, why the first piece of code below gives a parsing error, while the other two variations work? # Gives a parsing error x - 1 if (x 0) { y - 1 } else # Error occurs at this line { y - -1 } # This works x - 1 { if (x 0) { y - 1 } else { y - -1 } } # This works too x - 1 if (x 0) { y - 1 } else { y - -1 } Christian __ R-help@stat.math.ethz.ch 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] Strange parsing behavior of an else condition
On Tue, 8 Feb 2005, Christian Lederer wrote: can anybody explain the reason, why the first piece of code below gives a parsing error, while the other two variations work? # Gives a parsing error x - 1 if (x 0) { y - 1 } else # Error occurs at this line { y - -1 } # This works x - 1 { if (x 0) { y - 1 } else { y - -1 } } # This works too x - 1 if (x 0) { y - 1 } else { y - -1 } help(if) In the first case, the if expression is complete prior to the else, hence the error. The second case completes since the outer enclosing brace has not been processed. The third case completes since the else is on the same line as brace closing if expression and else expression not yet processed. There may also be issues whether you're running interactively or not. Recommend not using Whitesmith style brace formatting with R or S-plus. IMO, the following formatting style works best: sety - function(x) { if (x 0) { y - 1 } else { y - -1 } } -- SIGSIG -- signature too long (core dumped) __ R-help@stat.math.ethz.ch 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] RE: Reading Dates in a csv File
My first thought was that all it looked a bit complicated for something that should be straightforward. I created a file called t.txt. I worked out the way I would have done it and then I tested to see which was fastest. One little hiccup is that the two objects are not identical and I though they would be. Of course I could have made a typo somewhere. But then there may be something I have not come across. Guess it's time to see what identical really means. system.time({ + file - read.csv(t.txt,header=F, + col.names =c(c_field_1, + n_field_2, + d_field_3, + d_field_4, + n_field_5), + colClasses = c(character, + numeric, + character, + character, + numeric) + ) + file$d_field_3 - as.POSIXct(strptime(file$d_field_3,format=%m/%d/%Y )) + file$d_field_4 - as.POSIXct(strptime(file$d_field_4,format=%m/%d/%Y %I:%M:%S %p )) + }) [1] 0.00 0.00 0.02 NA NA read_file - function(file,nrows=-1) { + +# create temp classes +setClass(t_class_,representation(character)) +setAs(character, t_class_, function(from) + as.POSIXct(strptime(from,format=%m/%d/%Y))) + +setClass(t_class2_, representation(character)) +setAs(character, t_class2_, function(from) + as.POSIXct(strptime(from,format=%m/%d/%Y %I:%M:%S %p))) + +# read the file +file - read.csv(file, + header=FALSE, + comment.char = , + nrows=nrows, + as.is=FALSE, + col.names=c(c_field_1, + n_field_2, + d_field_3, + d_field_4, + n_field_5), + colClasses=c(character, + numeric, + t_class_, + t_class2_, + numeric) + ) + +# remove them now that we are done with them +removeClass(t_class_) +removeClass(t_class2_) + +return(file) + + } system.time(file2 - read_file(t.txt)) [1] 0.14 0.00 0.16 NA NA identical(file, file2) [1] FALSE file c_field_1 n_field_2 d_field_3 d_field_4 n_field_5 1 MHK 76.53 2004-05-21 2004-05-04 16:00:0060 2 MHK 76.53 2004-06-21 2004-05-05 16:00:0060 3 MHK 76.53 2004-07-21 2004-05-06 16:00:0065 4 MHK 76.53 2004-08-21 2004-05-07 16:00:0065 5 MHK 76.53 2004-09-21 2004-05-08 16:00:0070 file2 c_field_1 n_field_2 d_field_3 d_field_4 n_field_5 1 MHK 76.53 2004-05-21 2004-05-04 16:00:0060 2 MHK 76.53 2004-06-21 2004-05-05 16:00:0060 3 MHK 76.53 2004-07-21 2004-05-06 16:00:0065 4 MHK 76.53 2004-08-21 2004-05-07 16:00:0065 5 MHK 76.53 2004-09-21 2004-05-08 16:00:0070 str(file) `data.frame': 5 obs. of 5 variables: $ c_field_1: chr MHK MHK MHK MHK ... $ n_field_2: num 76.5 76.5 76.5 76.5 76.5 $ d_field_3:`POSIXct', format: chr 2004-05-21 2004-06-21 2004-07-21 2004-08-21 ... $ d_field_4:`POSIXct', format: chr 2004-05-04 16:00:00 2004-05-05 16:00:00 2004-05-06 16:00:00 2004-05-07 16:00:00 ... $ n_field_5: num 60 60 65 65 70 str(file2) `data.frame': 5 obs. of 5 variables: $ c_field_1: chr MHK MHK MHK MHK ... $ n_field_2: num 76.5 76.5 76.5 76.5 76.5 $ d_field_3:`POSIXct', format: chr 2004-05-21 2004-06-21 2004-07-21 2004-08-21 ... $ d_field_4:`POSIXct', format: chr 2004-05-04 16:00:00 2004-05-05 16:00:00 2004-05-06 16:00:00 2004-05-07 16:00:00 ... $ n_field_5: num 60 60 65 65 70 -Original Message- From: Charles and Kimberly Maner [mailto:[EMAIL PROTECTED] Sent: Tuesday, 8 February 2005 12:08 PM To: r-help@stat.math.ethz.ch Subject: [R] RE: Reading Dates in a csv File Hi all. Thanks for all of your help/suggestions. I found an old email in the R-help archives, pieced together a couple things and arrived at the solution below. As an additional followup, I thought I would go ahead and post it should other readers come across this same situation. Here goes.. Raw data: MHK,76.53,05/21/2004,5/4/2004 4:00:00 PM,60 MHK,76.53,06/21/2004,5/5/2004 4:00:00 PM,60 MHK,76.53,07/21/2004,5/6/2004 4:00:00 PM,65 MHK,76.53,08/21/2004,5/7/2004 4:00:00 PM,65 MHK,76.53,09/21/2004,5/8/2004 4:00:00 PM,70 Code: read_file - function(file,nrows=-1) { # create temp classes setClass(t_class_,representation(character)) setAs(character, t_class_, function(from) as.POSIXct(strptime(from,format=%m/%d/%Y)))
Re: [R] R on Beowulf cluster?
That's a shell/R script issue. I've come across it before, but I've no longer got access to any clusters of that form (yet :-). Depending on the jobs, it's not clear to me that you want a truly interactive process on a subnode, but the idea is the same as the chicanery we used to have a remote R process. best, -tony On Mon, 7 Feb 2005 14:59:33 -0500, Liaw, Andy [EMAIL PROTECTED] wrote: Dear R-help, Has anyone tried running R on a Beowulf-type cluster? I can get R to run in batch (using R CMD BATCH) on a cluster, but am wondering if it is possible to get an interactive R session on a compute node. Right now, if I run: beorun --nolocal R I just get the R start-up message and back to the shell prompt. If I try bpsh 0 R I can get R started (but the R prompt does not appear) and do computations, but no access to an x11() device. I'd very much appreciate any pointer. Best, Andy Andy Liaw, PhD Biometrics Research PO Box 2000, RY33-300 Merck Research Labs Rahway, NJ 07065 andy_liaw at merck.com 732-594-0820 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- best, -tony Commit early,commit often, and commit in a repository from which we can easily roll-back your mistakes (AJR, 4Jan05). A.J. Rossini [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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 on Beowulf cluster?
Hello! Sorry, may be I will just say something trivial, but: I can get R started (but the R prompt does not appear) and do computations, but no access to an x11() device. looks like you have started R with --slave switch and remote console has no DISPLAY environment variable set (or your X-server discards remote connections). Hope this help. __ R-help@stat.math.ethz.ch 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] Data manipulation
Content-Type: text/plain; charset=iso-8859-1 Received-SPF: none (hypatia: domain of [EMAIL PROTECTED] does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new at stat.math.ethz.ch Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hypatia.math.ethz.ch id j186djX0017423 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on hypatia.math.ethz.ch X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_50 autolearn=no version=3.0.2 Hi R-friends, i have large dataset in the following structure: BID;TERRCODE;ANMCODE 200310413290002;4;0 200310413290002;80;0 200310413290002;2;0 200310413290002;5;0 200310413290003;3;0 200310413290003;1;0 200310413290003;11;0 200310413290003;26;0 200310413290003;141;21 200310413290003;472;0 200310413290004;3;0 200310413290004;1;0 200310413290004;7;0 200310413290004;18;0 200310413290004;51;0 200310413290004;56;0 200310413290004;57;0 200310413290004;76;0 200310413290004;89;0 200310413290004;97;0 200310413290004;98;0 200310413290004;72;0 200310413290004;456;0 200310413290004;141;0 200310413290004;640;0 200310413290004;201;0 200310413290004;764;20 200310413290005;273;22 200310413290005;456;0 200310413290005;22;0 200310413290005;23;0 200310413290005;21;21 200310413290005;141;0 200310413290005;640;0 200310413290005;201;0 200310413290005;43;0 200310413290005;650;0 200310413290005;472;0 200310413290006;456;0 200310413290006;22;25 200310413290006;23;25 200310413290006;21;25 200310413290006;640;0 200310413290006;201;0 200310413290006;43;0 200310413290006;651;1 . . . BID is the code of my sample-area TERRCODE is the code for landscape characteristic for example: 640 ... sun exposed, . ANMCODE ist the value of the TERRCODE: for example 0 means occuring, 1 means often occuring, .. Now my question: is it possible to get a table with the folllowing structure: BID (TERRCODE)4 (TERRCODE)21 .. 200310413290002 (ANMCODE)0 (ANMCODE)0 ... 200310413290003 0 0 .. 200310413290004 0 0 .. 200310413290005 0 21 .. 200310413290006 0 . 25 .. . . in this example (TERRCODE) and (ANMCODE) is only for explanation and not necessary for further analysis greetings from the snowy tyrol helli platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 0.0 year 2004 month 10 day 04 language R __ Verschicken Sie romantische, coole und witzige Bilder per SMS! __ R-help@stat.math.ethz.ch 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] ROracle problem.
Tae Sik Han wrote: ROracle ploblem I can't install ROracle in the window XP. Is there any way to install ROracle package on the windows OS ? You can both, install from sources as descibed in the docs, as well as downloading a binary version from the maintainer's side: http://stat.bell-labs.com/RS-DBI/download/index.html Uwe Ligges I think I can enhance data acquisition performance using oracle native dirver instead of using ODBC. Tae Sik Han. North Carolina State University. __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] Data manipulation
Helmut Kudrnovsky wrote: Content-Type: text/plain; charset=iso-8859-1 Received-SPF: none (hypatia: domain of [EMAIL PROTECTED] does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new at stat.math.ethz.ch Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hypatia.math.ethz.ch id j186djX0017423 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on hypatia.math.ethz.ch X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_50 autolearn=no version=3.0.2 Hi R-friends, i have large dataset in the following structure: BID;TERRCODE;ANMCODE 200310413290002;4;0 200310413290002;80;0 200310413290002;2;0 200310413290002;5;0 200310413290003;3;0 200310413290003;1;0 200310413290003;11;0 200310413290003;26;0 200310413290003;141;21 200310413290003;472;0 200310413290004;3;0 200310413290004;1;0 200310413290004;7;0 200310413290004;18;0 200310413290004;51;0 200310413290004;56;0 200310413290004;57;0 200310413290004;76;0 200310413290004;89;0 200310413290004;97;0 200310413290004;98;0 200310413290004;72;0 200310413290004;456;0 200310413290004;141;0 200310413290004;640;0 200310413290004;201;0 200310413290004;764;20 200310413290005;273;22 200310413290005;456;0 200310413290005;22;0 200310413290005;23;0 200310413290005;21;21 200310413290005;141;0 200310413290005;640;0 200310413290005;201;0 200310413290005;43;0 200310413290005;650;0 200310413290005;472;0 200310413290006;456;0 200310413290006;22;25 200310413290006;23;25 200310413290006;21;25 200310413290006;640;0 200310413290006;201;0 200310413290006;43;0 200310413290006;651;1 . . . BID is the code of my sample-area TERRCODE is the code for landscape characteristic for example: 640 ... sun exposed, . ANMCODE ist the value of the TERRCODE: for example 0 means occuring, 1 means often occuring, .. Now my question: is it possible to get a table with the folllowing structure: BID (TERRCODE)4 (TERRCODE)21 .. 200310413290002 (ANMCODE)0 (ANMCODE)0 ... 200310413290003 0 0 .. 200310413290004 0 0 .. 200310413290005 0 21 .. 200310413290006 0 . 25 .. Perhaps, if you explain us the formula you derive those lines from the data above. At least I don't understand it. Uwe Ligges . in this example (TERRCODE) and (ANMCODE) is only for explanation and not necessary for further analysis greetings from the snowy tyrol helli platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 0.0 year 2004 month 10 day 04 language R __ Verschicken Sie romantische, coole und witzige Bilder per SMS! __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html