Re: [R] \ll and \gg in expression()

2008-02-10 Thread Peter Dalgaard
Prof Brian Ripley wrote: On Sat, 9 Feb 2008, Michael Kubovy wrote: On Feb 9, 2008, at 4:41 PM, Prof Brian Ripley wrote: On Sat, 9 Feb 2008, Michael Kubovy wrote: How do I enter 'much greater than' and 'much less than' symbols in an expression? Those are not in

Re: [R] writing a function

2008-02-10 Thread Johannes Hüsing
mohamed nur anisah [EMAIL PROTECTED] [Fri, Feb 08, 2008 at 04:42:41PM CET]: Dear lists, I'm in my process of learning of writing a function. I tried to write a simple functions of a matrix and a vector. Here are the codes: mm-function(m,n){ #matrix function

[R] Testing for differecnes between groups, need help to find the right test in R.

2008-02-10 Thread Kes Knave
Dear all, I have a data set with four different groups, for each group I have several observation (number of observation in each group are unequal), and I want to test if there are some differences in the values between the groups. What will be the most proper way to test this in R? Regards

[R] Using 'sapply' and 'by' in one function

2008-02-10 Thread David Natalia
Greetings, I'm having a problem with something that I think is very simple - I'd like to be able to use the 'sapply' and 'by' functions in 1 function to be able (for example) to get regression coefficients from multiple models by a grouping variable. I think that I'm missing something that is

Re: [R] Using 'sapply' and 'by' in one function

2008-02-10 Thread Gabor Grothendieck
By passing new to fxa via the second argument of fxa, new is not being subsetted hence the error. Try this: by(new, new$sex, function(x) sapply(x[1:2], function(y) coef(lm(y ~ Pred, x))) Actually, you can do the above without sapply as lm can take a matrix for the dependent variable: by(new,

Re: [R] Using 'sapply' and 'by' in one function

2008-02-10 Thread Gabor Grothendieck
Actually thinking about this, not only do you not need sapply but you don't even need by: new2 - transform(new, sex = factor(sex)) coef(lm(as.matrix(new2[1:2]) ~ sex/Pred - 1, new2)) On Feb 10, 2008 8:43 AM, Gabor Grothendieck [EMAIL PROTECTED] wrote: By passing new to fxa via the second

Re: [R] Which package should I use if I estimate a recursive model?

2008-02-10 Thread John Fox
Dear Yongfu He, If you mean a recursive structural-equation model, then if you're willing to assume normally distributed errors, equation-by-equation OLS regression, using lm(), will give you the full-information maximum-likelihood estimates of the structural coefficients. You could also use the

Re: [R] R on Mac PRO does anyone have experience with R on such a platform ?

2008-02-10 Thread Rod
On Feb 10, 2008 2:29 AM, Maura E Monville [EMAIL PROTECTED] wrote: I saw there exists an R version for Mac/OS. I'd like to hear from someone who is running R on a Mac/OS before venturing on getting the following computer system. I am in the process of choosing a powerful laptop 17 MB PRO

Re: [R] Do I need to use dropterm()??

2008-02-10 Thread Bernard Leemon
Hi Dani, it would be better to start with a question you are trying to ask of your data rather than trying to figure out what a particular function does. with your variables and model, even if the component terms were not significant, they must in the model or the product of sunlight and aspect

[R] Error in optim while using fitdistr() function

2008-02-10 Thread Jason Q. McClintic
I get the digest, so I apologize if this is a little late. For your situation (based on the description and what I think your code is doing, more on that below), it looks like you are modeling a Poisson flow where the number of hits per unit time is a random integer with some mean value. If I

Re: [R] Using 'sapply' and 'by' in one function

2008-02-10 Thread hadley wickham
On Feb 10, 2008 8:25 AM, Gabor Grothendieck [EMAIL PROTECTED] wrote: Actually thinking about this, not only do you not need sapply but you don't even need by: new2 - transform(new, sex = factor(sex)) coef(lm(as.matrix(new2[1:2]) ~ sex/Pred - 1, new2)) Although that's a very slightly

Re: [R] Error while using fitdistr() function or goodfit() function

2008-02-10 Thread Aswad Gurjar
Hello, Thanks that helped for poisson. When I changed method to ML it worked for poisson but when I used that for nbinomial I got errors.But why is this happening? gf-goodfit(binCount,type= poisson) summary(gf) Goodness-of-fit test for poisson distribution X^2 df P(

Re: [R] Using 'sapply' and 'by' in one function

2008-02-10 Thread hadley wickham
Although that's a very slightly different model, as it assumes that both sexes have the same error variance. But the output are the coefficients and they are identical. For the sake of an example I'm sure that David simply omitted the part of his analysis where he looked at the standard

Re: [R] building packages for Linux vs. Windows

2008-02-10 Thread Duncan Murdoch
On 10/02/2008 1:07 PM, Erin Hodgess wrote: Hi R People: I sure that this is a really easy question, but here goes: I'm trying to build a package that will run on both Linux and Windows. However, there are several commands in a section that will be different in Linux than they are in

[R] building packages for Linux vs. Windows

2008-02-10 Thread Erin Hodgess
Hi R People: I sure that this is a really easy question, but here goes: I'm trying to build a package that will run on both Linux and Windows. However, there are several commands in a section that will be different in Linux than they are in Windows. Would I be better off just to build two

[R] prcomp vs. princomp vs fast.prcomp

2008-02-10 Thread Erin Hodgess
Hi R People: When performing PCA, should I use prcomp, princomp or fast.prcomp, please? thanks. Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: [EMAIL PROTECTED] __

Re: [R] building packages for Linux vs. Windows

2008-02-10 Thread John Sorkin
On my widows XP computer, W From my windows XP system running R 2.6.1: version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32

Re: [R] building packages for Linux vs. Windows

2008-02-10 Thread Ted Harding
On 10-Feb-08 18:07:56, Erin Hodgess wrote: Hi R People: I sure that this is a really easy question, but here goes: I'm trying to build a package that will run on both Linux and Windows. However, there are several commands in a section that will be different in Linux than they are in

Re: [R] [R-sig-Geo] Comparing spatial point patterns - Syrjala test

2008-02-10 Thread jiho
Hi, I went ahead and implemented something. However: - I cannot garantie it gives correct results since, unfortunately, the data used in Syrjala 1996 is not published along with the paper. To avoid mistakes, I started by coding things in a fast and simple way and then tried to optimize the

Re: [R] grep etc.

2008-02-10 Thread Gabor Csardi
sub(-, --, v, fixed=TRUE) See ?sub. Gabor On Sun, Feb 10, 2008 at 02:14:48PM -0500, Michael Kubovy wrote: Dear R-helpers, How do I transform v - c('insd-otsd', 'sppr-unsp') into c('insd--otsd', 'sppr--unsp') ? _ Professor Michael Kubovy University of

[R] grep etc.

2008-02-10 Thread Michael Kubovy
Dear R-helpers, How do I transform v - c('insd-otsd', 'sppr-unsp') into c('insd--otsd', 'sppr--unsp') ? _ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400Charlottesville, VA 22904-4400 Parcels:Room 102

Re: [R] Vector Size

2008-02-10 Thread John Kane
You just have too large a vector for your memory. There is not much you can do with an object of 500 MG. You have over 137 million combinations. What are you trying to do with this vector? --- Oscar A [EMAIL PROTECTED] wrote: Hello everybody!! I'm from Colombia (South America) and I'm new

[R] [OT] good reference for mixed models and EM algorithm

2008-02-10 Thread Erin Hodgess
Dear R People: Sorry for the off-topic. Could someone recommend a good reference for using the EM algorithm on mixed models, please? I've been looking and there are so many of them. Perhaps someone here can narrow things down a bit. Thanks in advance, Sincerely, Erin -- Erin Hodgess

[R] data frame question

2008-02-10 Thread joseph
Hello I have 2 data frames df1 and df2. I would like to create a new data frame new_df which will contain only the common rows based on the first 2 columns (chrN and start). The column score in the new data frame should be replaced with a column containing the average score (average_score) from

Re: [R] [OT] good reference for mixed models and EM algorithm

2008-02-10 Thread Spencer Graves
Hi, Erin: Have you looked at Pinheiro and Bates (2000) Mixed-Effects Models in S and S-Plus (Springer)? As far as I know, Doug Bates has been the leading innovator in this area for the past 20 years. Pinheiro was one of his graduate students. The 'nlme' package was developed

Re: [R] data frame question

2008-02-10 Thread Mark Wardle
On 10/02/2008, joseph [EMAIL PROTECTED] wrote: Hello I have 2 data frames df1 and df2. I would like to create a new data frame new_df which will contain only the common rows based on the first 2 columns (chrN and start). The column score in the new data frame should be replaced with a

Re: [R] data frame question

2008-02-10 Thread David Winsemius
joseph [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: I have 2 data frames df1 and df2. I would like to create a new data frame new_df which will contain only the common rows based on the first 2 columns (chrN and start). The column score in the new data frame should be replaced with a

Re: [R] prcomp vs. princomp vs fast.prcomp

2008-02-10 Thread Liviu Andronic
On 2/10/08, Erin Hodgess [EMAIL PROTECTED] wrote: When performing PCA, should I use prcomp, princomp or fast.prcomp, please? You can take a look here [1] and here [2] for some short references. From the first page: Principal Components Analysis (PCA) is available in prcomp() (preferred) and

Re: [R] Applying lm to data with combn

2008-02-10 Thread Henrique Dallazuanna
I think that what you want do is stepwise, see step function On 09/02/2008, AliR [EMAIL PROTECTED] wrote: Thank you, can you suggest wht is the shortest way to store the combination with min residual error term? AliR wrote: http://www.nabble.com/file/p15359204/test.data.csv

[R] reshape

2008-02-10 Thread juli pausas
Dear colleagues, I'd like to reshape a datafame in a long format to a wide format, but I do not quite get what I want. Here is an example of the data I've have (dat): sp - c(a, a, a, a, b, b, b, c, d, d, d, d) tr - c(A, B, B, C, A, B, C, A, A, B, C, C) code - c(a1, a2, a2, a3, a3, a3, a4, a4, a4,

Re: [R] reshape

2008-02-10 Thread Henrique Dallazuanna
reshape(dat, direction=wide, timevar=tr, idvar=c(id, code,sp ))[,2:6] But, I don't understand why you use reshape On 10/02/2008, juli pausas [EMAIL PROTECTED] wrote: Dear colleagues, I'd like to reshape a datafame in a long format to a wide format, but I do not quite get what I want. Here is

Re: [R] reshape

2008-02-10 Thread Gabor Grothendieck
This isn't really well defined. Suppose we have two rows that both have a, a2 and a value for B. Now suppose we have another row with a,a2 but with a value for C. Does the third row go with the first one? the second one? a new row? both the first and the second? Here is one possibility but

Re: [R] Do I need to use dropterm()??

2008-02-10 Thread Bill.Venables
dropterm() is a tool for model building, not primarily for significance testing. As the name suggests, it tells you what the effect would be were you to drop each *accessible* term in the model as it currently stands. By default it displays the effect on AIC of dropping each term, in turn, from

[R] j and jcross queries

2008-02-10 Thread Robert Biddle
Hi: I have a query related to the J and Jcross functions in the SpatStat package. I use J to finding indications of clustering in my data, and Jcross to look for dependence between point patterns. I use the envelope function to do Monte Carlo tests to look for significance. So far so good.

[R] Questions about histograms

2008-02-10 Thread Andre Nathan
Hello I'm doing some experiments with the various histogram functions and I have a two questions about the prob option and binning. First, here's a simple plot of my data using the default hist() function: hist(data[,1], prob = TRUE, xlim = c(0, 35)) http://go.sneakymustard.com/tmp/hist.jpg

Re: [R] Questions about histograms

2008-02-10 Thread Duncan Murdoch
On 10/02/2008 8:14 PM, Andre Nathan wrote: Hello I'm doing some experiments with the various histogram functions and I have a two questions about the prob option and binning. First, here's a simple plot of my data using the default hist() function: hist(data[,1], prob = TRUE, xlim =

Re: [R] Questions about histograms

2008-02-10 Thread Bill.Venables
Andre, Regarding your first question, it is by no means clear there is anything to fix, in fact I'm sure there is nothing to fix. The fact that the height of any bar is greater than one is irrelevant - the width of the bar is much less than one, as is the product of height by width. Area is

[R] Using R in a university course: dealing with proposal comments

2008-02-10 Thread Arin Basu
Hi All, I am scheduled to teach a graduate course on research methods in health sciences at a university. While drafting the course proposal, I decided to include a brief introduction to R, primarily with an objective to enable the students to do data analysis using R. It is expected that

Re: [R] Using R in a university course: dealing with proposal comments

2008-02-10 Thread Bill.Venables
Comment 1 raises a real issue. R is just a tool. Too often people do confuse the tool with the real skill that the people who use it should have. There are plenty of questions on R-help that demonstrate this confusion. It's well worth keeping in mind and acting upon if you can see a problem

Re: [R] Using R in a university course: dealing with proposal comments

2008-02-10 Thread Liviu Andronic
Hello Arin, If your future students do not know statistics, you might consider buffering their introduction to R with the help of a GUI package, such as Rcmdr (if functionality is missing, you could add it yourself via the plugin infrastructure). Another way to help students would be to direct

[R] Help with write.csv

2008-02-10 Thread Suhaila Zainudin
Dear all, I am new to R. I am using the impute package with data contained in csv file. I have followed the example in the impute package as follows: mydata = read.csv(sample_impute.csv, header = TRUE) mydata.expr - mydata[-1,-(1:2)] mydata.imputed - impute.knn(as.matrix(mydata.expr)) The

Re: [R] Using R in a university course: dealing with proposal comments

2008-02-10 Thread Spencer Graves
R is just a tool, but so is English. R is the platform of choice for an increasing portion of people involved in new statistical algorithm development. R is not yet the de facto standard for nearly all serious research internationally, to the extent that English is. However, I believe

[R] tree() producing NA's

2008-02-10 Thread Amnon Melzer
Hi Hoping someone can help me (a newbie). I am trying to construct a tree using tree() in package tree. One of the fields is a factor field (owner), with many levels. In the resulting tree, I see many NA's (see below), yet in the actual data there are none. rr200.tr - tree(backprof ~