Re: [R] Matched pairs with two data frames

2008-04-13 Thread Udo
Zitat von Peter Alspach <[EMAIL PROTECTED]>: > Udo > > Seems you might want merge() > > HTH ... > > Peter Alspach Thank you Peter and Jorge, but as I had written in my last sentence, "Merge doesn´t do the job, because it makes all possible matches", but maybe there is a sophisticated solutio

Re: [R] Equivalent to a BY command in SAS

2008-04-13 Thread Rolf Turner
On 14/04/2008, at 2:36 PM, zerfetzen wrote: > > Hi, > I'm very new to R and absolutely love it. Does anyone know how to use > something in R that functions like a BY command in SAS? > > For example, let's say you have a variable x, and you want to see > the mean. > Easy... > >> mean(x) > > But

[R] looping problem

2008-04-13 Thread Roslina Zakaria
Hi R-users, I would like to do looping for this process below to estimate alpha beta from gamma distribution: Here are my data: day_data1 <- 123456 789 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1943 48.3 18.5 0.0 0.0 18.3 0.0

Re: [R] Equivalent to a BY command in SAS

2008-04-13 Thread Vincent Goulet
Le dim. 13 avr. à 22:36, zerfetzen a écrit : > > Hi, > I'm very new to R and absolutely love it. Does anyone know how to use > something in R that functions like a BY command in SAS? > > For example, let's say you have a variable x, and you want to see > the mean. > Easy... > >> mean(x) > > But

Re: [R] Equivalent to a BY command in SAS

2008-04-13 Thread Dylan Beaudette
On Sun, Apr 13, 2008 at 7:36 PM, zerfetzen <[EMAIL PROTECTED]> wrote: > > Hi, > I'm very new to R and absolutely love it. Does anyone know how to use > something in R that functions like a BY command in SAS? > > For example, let's say you have a variable x, and you want to see the mean. > Eas

[R] Equivalent to a BY command in SAS

2008-04-13 Thread zerfetzen
Hi, I'm very new to R and absolutely love it. Does anyone know how to use something in R that functions like a BY command in SAS? For example, let's say you have a variable x, and you want to see the mean. Easy... > mean(x) But what if you want to see the mean of x conditional on another disc

Re: [R] R equivalent of erfcinv in matlab

2008-04-13 Thread Bill.Venables
That's not a bad idea. If the wiki comes up again, please do it. They are so short I wonder that they just can't go in to base R though. It's not particularly matlab terminology, it's engineering and physics terminology pretty widely. See, e.g. Abramowitz and Stegun. For specifcity, here are th

Re: [R] prediction intervals from a mixed-effects models?

2008-04-13 Thread Gregory Warnes
On Apr 13, 2008, at 1:41PM , Dieter Menne wrote: > Spencer Graves pdf.com> writes: > >> >> How can I get prediction intervals from a mixed-effects model? >> Consider the following example: >> >> library(nlme) >> fm3 <- lme(distance ~ age*Sex, data = Orthodont, random = ~ 1) >> df3.1 <- with

Re: [R] SQL INSERT using RMySQL

2008-04-13 Thread Gregory Warnes
Hi All, I figured out my problem. There was a combination of lack of understanding on my part, and a bit of missing functionality. I made a small patch to the rmysqlWriteTable() function passes the field names to MySQL corresponding to the data columns passed in: diff -ru RMySQL.orig/R/M

Re: [R] R equivalent of erfcinv in matlab

2008-04-13 Thread Ben Bolker
csiro.au> writes: > > At a guess ... > > > erfc <- function(x) 2 * pnorm(x * sqrt(2), lower = FALSE) > > erfcinv <- function(x) qnorm(x/2, lower = FALSE)/sqrt(2) > > erfc(0.3) > [1] 0.6713732 > > erfcinv(erfc(0.3)) > [1] 0.3 > > > > It may not hurt to include these wrappers in R for matlab r

Re: [R] R equivalent of erfcinv in matlab

2008-04-13 Thread sun
[EMAIL PROTECTED] wrote: > At a guess ... > >> erfc <- function(x) 2 * pnorm(x * sqrt(2), lower = FALSE) >> erfcinv <- function(x) qnorm(x/2, lower = FALSE)/sqrt(2) >> erfc(0.3) > [1] 0.6713732 >> erfcinv(erfc(0.3)) > [1] 0.3 > > It may not hurt to include these wrappers in R for matlab refugees.

Re: [R] [Fwd: Re: Response to R across the university]

2008-04-13 Thread Jim Porzak
Tom, Yes, just re-execute JGR-15.exe (I assume your are on windows & downloaded the latest version). Window's explorer search should find it. For convenience, I make a shortcut on my desktop pointing to JGR-xxx.exe. BTW, I do most of my development work in JGR. Thanks to all the Augsburg JGR tea

Re: [R] [Fwd: Re: Response to R across the university]

2008-04-13 Thread Liviu Andronic
On Sun, Apr 13, 2008 at 11:36 PM, Tom Backer Johnsen <[EMAIL PROTECTED]> wrote: > On the other hand, I cannot see how to launch the thing again once I > have closed that window. There is supposed to be a launcher somewhere > (JGR.exe?), but I have not been able to find it. It does not seem to

Re: [R] R equivalent of erfcinv in matlab

2008-04-13 Thread Bill.Venables
At a guess ... > erfc <- function(x) 2 * pnorm(x * sqrt(2), lower = FALSE) > erfcinv <- function(x) qnorm(x/2, lower = FALSE)/sqrt(2) > erfc(0.3) [1] 0.6713732 > erfcinv(erfc(0.3)) [1] 0.3 > It may not hurt to include these wrappers in R for matlab refugees. They seem to be coming thick and fast

Re: [R] R equivalent of erfcinv in matlab

2008-04-13 Thread sun
Peter Dalgaard wrote: > sun wrote: >> I am converting some matlab code into R that use inverse of the >> complementary error function, erfcinv and did not find an equivalent in >> R, is there such a function in some contributed modules? >> >> > Basically, it is qnorm() with suitable scaling. T

Re: [R] Mapping file-Legend- from 2 Files/Tables

2008-04-13 Thread Edwin Sendjaja
Hello, Because no one has answered this. I presume that no one knows the soluition. Fortunately, I found the solution: Keyword: merge() -- table1<-read.table("Salesman.data") table2<-read.table("Employee.data") data<-merge(

[R] Calinsky and Harabasz Index for Cluster Determination with Diana in R

2008-04-13 Thread ozgun.harmanci
Hello all, I have a set of data points, which I have pair distances for. I managed to create dendrogram for this data set using diana() in R, however this only gives me the tree and not the clusters themselves. I am trying to determine clusters using Calinsky and Harabasz Index (CH Index). I, howev

Re: [R] Matched pairs with two data frames

2008-04-13 Thread Jorge Ivan Velez
Hi Udo, Perhaps > merge(treat,control) does what you need. I hope this helps, Jorge On Sun, Apr 13, 2008 at 2:41 PM, Udo <[EMAIL PROTECTED]> wrote: > Hi, > I have a frame "treat" and want to find matched pairs in the data frame > "control". In the matched (combined) data frame there should

Re: [R] R equivalent of erfcinv in matlab

2008-04-13 Thread Peter Dalgaard
sun wrote: > I am converting some matlab code into R that use inverse of the > complementary error function, erfcinv and did not find an equivalent in > R, is there such a function in some contributed modules? > > Basically, it is qnorm() with suitable scaling. The help page for Normal has th

[R] [Fwd: Re: Response to R across the university]

2008-04-13 Thread Tom Backer Johnsen
Well, I downloaded the install JGR package for Windows and that seemed to work fine, after the installation I ended up with a modified R window which looked nice and uncluttered. Which I like. Very much. On the other hand, I cannot see how to launch the thing again once I have closed that window

[R] [Fwd: Re: Assigning to multiple variables]

2008-04-13 Thread Tom Backer Johnsen
Scott Romans wrote: > If we have a function that returns 2 or more values (such as dim as > applied to a matrix), can we assign these 2 or more values to an equal > number of differently named variables in one line? For example, is > there any way to do something like this: > > [NumberRows N

Re: [R] Assigning to multiple variables

2008-04-13 Thread Gabor Grothendieck
Normally in R one returns a list and assigns that to a single variable but if you really want to do it here is how: http://tolstoy.newcastle.edu.au/R/help/04/06/1430.html On Sun, Apr 13, 2008 at 4:56 PM, Scott Romans <[EMAIL PROTECTED]> wrote: > If we have a function that returns 2 or more values

[R] R equivalent of erfcinv in matlab

2008-04-13 Thread sun
I am converting some matlab code into R that use inverse of the complementary error function, erfcinv and did not find an equivalent in R, is there such a function in some contributed modules? Thanks. __ R-help@r-project.org mailing list https://stat.

[R] Assigning to multiple variables

2008-04-13 Thread Scott Romans
If we have a function that returns 2 or more values (such as dim as applied to a matrix), can we assign these 2 or more values to an equal number of differently named variables in one line? For example, is there any way to do something like this: [NumberRows NumberColumns] <- dim(MatrixA) T

Re: [R] nonlinear curve fitting on a torus

2008-04-13 Thread Spencer Graves
Having seen no reply to this, I will offer a couple of comments that may or may not be useful. Googling for "geodesic equation on a torus" produced interesting hits, but RSiteSearch("geodesic equation on a torus") found nothing. RSiteSearch("torus") returned 33 hits, some of which refer

Re: [R] question about nlminb

2008-04-13 Thread Spencer Graves
It's very well known that if a random vector X has a finite mean mu and covariance Sig, and Y = A X, then (1) EY = A %*% mu and (2) cov(Y) = A %*% Sig %*% t(X) = tcrossprod(A %*% Sig, A) Expression (1) says that mathematical expectation is a linear operator. Expressio

Re: [R] Matched pairs with two data frames

2008-04-13 Thread Peter Alspach
Udo Seems you might want merge() HTH ... Peter Alspach > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Udo > Sent: Monday, 14 April 2008 6:41 a.m. > To: r-help@r-project.org > Subject: [R] Matched pairs with two data frames > > Hi, > I hav

Re: [R] question about nlminb

2008-04-13 Thread John Pitchard
Hi Spencer, Thanks for your email. Do you have a reference for generating the variance-covariance matrix from the restricted variance-covariance? Is this a well known technique? Regards, John On 10/04/2008, Spencer Graves <[EMAIL PROTECTED]> wrote: > Hi, John: > I just got the following er

Re: [R] plotting muliple CI ellipses for EB estimates

2008-04-13 Thread John Fox
Dear Samuel, The radius reflect the desired coverage of the ellipse. You should be able to use radius <- sqrt(qchisq(.95, 2)), I think. I hope this helps, John John Fox, Professor Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 905

[R] Matched pairs with two data frames

2008-04-13 Thread Udo
Hi, I have a frame "treat" and want to find matched pairs in the data frame "control". In the matched (combined) data frame there should be two variables (0/1),indicating the "source" of the data (treat or control), so that it is possibe to set a "filter" (extraxt/select data). #Here are the dataf

Re: [R] mgcv::predict.gam lpmatrix for prediction outside of R

2008-04-13 Thread Simon Wood
On Wednesday 09 April 2008 16:18, David Katz wrote: > This is in regards to the suggested use of type="lpmatrix" in the > documentation for mgcv::predict.gam. Could one not get the same result more > simply by using type="terms" and interpolating each term directly? What is > the advantage of the l

[R] Re peatedly apply multiple functions to subsets of data.

2008-04-13 Thread Claire Jouseau
Dear R-users: I have a large dataframe with the following format: >plants id trt yearsizenum spA spB spZ 1011a 1 1 23.23 12 3.2 8 1011a 1 2 17.92 10

Re: [R] prediction intervals from a mixed-effects models?

2008-04-13 Thread Dieter Menne
Spencer Graves pdf.com> writes: > > How can I get prediction intervals from a mixed-effects model? > Consider the following example: > > library(nlme) > fm3 <- lme(distance ~ age*Sex, data = Orthodont, random = ~ 1) > df3.1 <- with(Orthodont, data.frame(age=seq(5, 20, 5), >

[R] R project

2008-04-13 Thread Nicola Smith
Hi,I am currently doing a project in which we are to investigate the size and power of three different one sample tests over three different distributions using a number of different sample sizes and values for mu1. I have written a function and was trying to get my answer for each test into th

[R] prediction intervals from a mixed-effects models?

2008-04-13 Thread Spencer Graves
How can I get prediction intervals from a mixed-effects model? Consider the following example: library(nlme) fm3 <- lme(distance ~ age*Sex, data = Orthodont, random = ~ 1) df3.1 <- with(Orthodont, data.frame(age=seq(5, 20, 5), Subject=rep(Subject[1], 4),

Re: [R] Response to R across the university

2008-04-13 Thread John Kane
http://stats.math.uni-augsburg.de/JGR/ Obviously a shameless product plug :) --- Tom Backer Johnsen <[EMAIL PROTECTED]> wrote: > Antony Unwin wrote: > > . > > > > The course itself went very well. We encouraged > people to bring their > > laptops and work in groups. Usi

[R] plotting muliple CI ellipses for EB estimates

2008-04-13 Thread Sam Field
I have empirical Bayes estimates for slopes and intercepts for a number of subjects and I would like to plot the slopes and intercepts with confidence ellipses. These ellipses would be based on the confidence intervals for the slope and intercepts (forming the major and minor axis of each ellips

Re: [R] .Rprofile, date tagging history, loading packages

2008-04-13 Thread Duncan Murdoch
Muenchen, Robert A (Bob) wrote: > Dear R-Helpers, > > I'm fiddling with my .Rprofile in Windows XP & R 2.7.0 Beta. I prefer to > manually save my workspace but automatically save my command history via > the .Rprofile. That is working fine once I found that "utils::" was > required before the loadh

[R] .Rprofile, date tagging history, loading packages

2008-04-13 Thread Muenchen, Robert A (Bob)
Dear R-Helpers, I'm fiddling with my .Rprofile in Windows XP & R 2.7.0 Beta. I prefer to manually save my workspace but automatically save my command history via the .Rprofile. That is working fine once I found that "utils::" was required before the loadhistory & savehistory functions. What I woul

Re: [R] Computing time when calling C functions - why does an extra function call induce such an overhead?

2008-04-13 Thread Prof Brian Ripley
I've not seen any reposnse to this, probably because -- this is not the list for C programming questions (use R-devel) -- there is no example provided for the times quoted. -- the code is not compilable. But I got a compiler warning on int *ipiv = (int *) R_alloc((int) nrA, sizeof(int)); f

[R] getGraphicsEvent plotting two graph

2008-04-13 Thread cgenolin
Hi the list, I need to use getGraphicsEvent to plot two graph. On the following toy example: - the function b is ploting two graph depending on a parameter - the function a is calling b according to some user answers. It is suppose to call b until the user press Return, but it does not. b <- f

Re: [R] lm() of one matrix against another

2008-04-13 Thread baptiste Auguié
Thanks for both replies, here is the cleaner version, > > n<-5 > N<-10 > > data.x<-matrix(1:(n*N),ncol=n) > data.y<-matrix(1:(n*N) + rnorm(n*N,sd=1),ncol=n) > > matplot(data.x,data.y,t="p",pch=1:n,bty="n") > > mapply(function(x,y){res <- lm(y~x) ; lines(x,predict(res)) ; res} , > as.

Re: [R] R help for PMML models

2008-04-13 Thread Tobias Verbeke
>What would be the syntax for outputting a linear regression model and /or a >logistic regression model to PMML . There is a pmml.lm method in the pmml package (on CRAN). I have improved code for that (and a pmml.glm) based on a student (Ashraf Fouadi) traineeship I supervised. It is planned t

[R] R help for PMML models

2008-04-13 Thread ajay ohri
Hi List, What would be the syntax for outputting a linear regression model and /or a logistic regression model to PMML . Regards, Ajay www.decisionstats.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://s

Re: [R] Arrays and functions

2008-04-13 Thread Ted Harding
On 13-Apr-08 08:43:33, Louisa Hay wrote: > Hi, > I' am doing a stats project using R to work out the size > of a t-test and wilcoxon test depending on the distribution > and sample size. > > I just can't get it to work - I want to put my results from > the function size() into an array. > > At th

[R] Arrays and functions

2008-04-13 Thread Louisa Hay
Hi, I' am doing a stats project using R to work out the size of a t-test and wilcoxon test depending on the distribution and sample size. I just can't get it to work - I want to put my results from the function size() into an array.At the moment I keep getting the error message:Error in res[dis

Re: [R] Skipping specified rows in scan or read.table

2008-04-13 Thread Paul Smith
On Wed, Apr 9, 2008 at 7:37 PM, Ravi Varadhan <[EMAIL PROTECTED]> wrote: > I have a data file, certain lines of which are character fields. I would > like to skip these rows, and read the data file as a numeric data frame. I > know that I can skip lines at the beginning with read.table and sca

[R] Arrays and functions

2008-04-13 Thread Louisa Hay
Hi, I' am doing a stats project using R to work out the size of a t-test and wilcoxon test depending on the distribution and sample size. I just can't get it to work - I want to put my results from the function size() into an array.At the moment I keep getting the error message:Error in res[dis

Re: [R] Extracting a data.frame from HTML code

2008-04-13 Thread Paul Smith
On Sun, Apr 13, 2008 at 12:37 AM, Martin Morgan <[EMAIL PROTECTED]> wrote: > Hi Ethan -- > > Use the XML library > > > library(XML) > > url <- > 'http://www.nascar.com/races/cup/2007/1/data/standings_official.html' > > xml <- htmlTreeParse(url, useInternal=TRUE) > > The previous line retrieve

Re: [R] Response to R across the university

2008-04-13 Thread ronggui
JGR (speak 'Jaguar') is a universal and unified Graphical User Interface for R (it actually abbreviates Java Gui for R). see http://stats.math.uni-augsburg.de/JGR/ On Sun, Apr 13, 2008 at 2:51 PM, Tom Backer Johnsen <[EMAIL PROTECTED]> wrote: > Antony Unwin wrote: > > . > > >