Re: [R] maximum/minimum value of a function

2009-07-11 Thread Barry Rowlingson
On Sat, Jul 11, 2009 at 6:24 AM, milton rusermilton.ru...@gmail.com wrote: my.values-myfunction(1,10,100) min(my.values) max(my.values) That finds the minimum and maximum of a limited sample from a univariate function. Extending this method to ten dimensions might be a bit tricky... If you

Re: [R] another matrix problem

2009-07-11 Thread Erich Neuwirth
rotateleft-function(vec,offset) vec[(((0:(length(vec)-1))+offset) %% length(vec)) + 1] rotateright-function(vec,offset)rotateleft(vec,length(vec)-offset) rotatedcols- function (vec ,offsets)do.call(cbind,lapply(offsets,function(x)rotateright(vec,x))) rotatedcols(1:5,0:2) is perhaps what

Re: [R] Is there any Gauss-newton library/function in R?

2009-07-11 Thread Berend Hasselman
Hao Jiang wrote: Hi,I am a newbie to R. I wrote a simple Gauss-newton method in least square minimization problems, but it looks not working well. Is there any Gauss-newton library/function in R? Try ??leastsquares and ?nls Berend -- View this message in context:

Re: [R] hands-on classification tutorial needed...

2009-07-11 Thread Christian Schulz
Hi, did you balance your trainset? IMHO in the caret package are helpful functions for doing grid-search with different classifiers. http://cran.r-project.org/web/packages/caret/vignettes/caretTrain.pdf HTH,Christian Hi all, I am doing binary classification and want to improve the

Re: [R] generalized linear model (glm) and stepAIC

2009-07-11 Thread Simone Santoro
First of all, thank you for replying me. I believe that using a statistical software (like R) and understanding the statistical issues beyond the software are two concepts with a strong link, but I understand that your scope is providing information on the way R works (so how to use it). For

Re: [R] arr.lcol in plotmat from diagram package

2009-07-11 Thread Soetaert, Karline
Dear Rajesh, A quick reply to your questions concerning the diagram package To use different colors per arrow : just define arr.col as a matrix or a data.frame, and give the color number or name to each arrow: To use numbers: M - matrix(nrow=4,ncol=4,data=0) M[2,1]-1

Re: [R] drawing hmms

2009-07-11 Thread Soetaert, Karline
Rajesh, To add a plot next each graph node I would open a new figure, with smaller size (see ?par) a. The plotmat function returns the position of all elements (in the example in pp). pp$comp contains the position of the boxes. b. Choose the position of the new figure (fig) and tell R not

[R] Heckman Selection Model/Inverse Mills Ratio

2009-07-11 Thread saurav pathak
I have so far used the following command glm(formula = s ~ age + gender + gemedu + gemhinc + es_gdppc + imf_pop + estbbo_m, family = binomial(link = probit)) My question is 1. How do i discard the non significant selection variables (one out of the seven variables above is non-significant)

Re: [R] diagram package graph margins

2009-07-11 Thread Soetaert, Karline
Rajesh, To change the margins, use par(mar):: M - matrix(nrow=4,ncol=4,data=0) M[2,1]-1 ;M[4,2]-2;M[3,4]-3;M[1,3]-4 par (mar=c(0,0,0,0)) pp-plotmat(M,pos=c(1,2,1),curve=0.) Karline [[alternative HTML version deleted]] __

[R] Conditional expand.grid()

2009-07-11 Thread Hesen Peng
Hello my R buddies, I'm trying to generate a bivariate data.frame with the elements of first row greater than the second row. The more complicated method that I can think of is: n - 10 temp - expand.grid(1:n,1:n) temp-temp[temp[,1]temp[,2],] However, I guess there must be some easier

[R] Passing arguments to forked children

2009-07-11 Thread nabble . 30 . miller_2555
Hi - I have attempted to use the fork::fork() function to perform parallel processing. However, the child R function called needs to know a given set of parameters to complete its task. Specifically, I iterate through a vector, and output values based on the elements of that vector to a

Re: [R] ReShape/cast question - sum of value in table

2009-07-11 Thread Ista Zahn
From: Mark Knecht markkne...@gmail.com To: r-help r-help@r-project.org Date: Fri, 10 Jul 2009 09:07:29 -0700 Subject: Re: [R] ReShape/cast question - sum of value in table On Fri, Jul 10, 2009 at 8:38 AM, Mark Knechtmarkkne...@gmail.com wrote: Hi Mark, You can simplify the code a bit: SNIP  

Re: [R] generalized linear model (glm) and stepAIC

2009-07-11 Thread Ben Bolker
Simone Santoro wrote: Simone Santoro wrote: I have 1! 2 response variables (species growth rates) and two envir onmental factors that I want to test to find out a possible relation. The sample size is quite small: (7n12, depending on each species-case). I performed a Shapiro test

Re: [R] drawing hmms

2009-07-11 Thread rajesh j
Hi, Thanks a lot! That worked wonders! Dint know R was that flexible.I was looking for packages that do it in vain. On Sat, Jul 11, 2009 at 6:10 PM, Soetaert, Karline k.soeta...@nioo.knaw.nlwrote: Rajesh, To add a plot next each graph node I would open a new figure, with smaller size

Re: [R] Passing arguments to forked children

2009-07-11 Thread Godmar Back
On Fri, Jul 10, 2009 at 8:16 PM, nabble.30.miller_2...@spamgourmet.com wrote: Hi -    I have attempted to use the fork::fork() function to perform parallel processing. However, the child R function called needs to know a given set of parameters to complete its task. Specifically, I iterate

Re: [R] Conditional expand.grid()

2009-07-11 Thread jim holtman
?combn combn(10,2) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [1,]111111111 2 2 2 2 2 2 2 2 [2,]23456789 10 3 4 5 6 7 8

[R] Weighted Analysis in Data Mining

2009-07-11 Thread Axel Urbiz
Dear R community, I’m new in R (coming from SAS). If possible, I’d like to know your thoughts regarding the following. I’m working on a regression problem, where my dependent variable is a ratio of two variables (i.e. dep.var=A/B). The variable A takes a value of zero for the vast majority of

Re: [R] Conditional expand.grid()

2009-07-11 Thread Hesen Peng
Ah, that's exactly what I'm looking for. Thanks a lot. On Sat, Jul 11, 2009 at 11:23 AM, jim holtmanjholt...@gmail.com wrote: ?combn combn(10,2)     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [1,]    1    1    1    1    1    1    1    1  

[R] seeking consultant on data-mining and pattern classification...

2009-07-11 Thread Michael
Hi all, My friends are looking for a consultant on data-mining and pattern classification, hopefully in the San Fransisco and Silicon Valley area. Please send me an email and I will forward to my friends. Thank you! __ R-help@r-project.org mailing

Re: [R] prevalence in logistic regression lrm()

2009-07-11 Thread Harrell, Frank E
This is dangerous because prevalence is an ill-defined concept. Most discussions of prevalence fail to understand conditioning completely. If you must, you can do this with an appropriate offset() term. Frank Hi, I am wondering if there is a way to specify the prevalence of events in

[R] Date conversions

2009-07-11 Thread Mark Knecht
Hi all, I'm having a little bit of trouble with some date conversions and am hoping someone can help me out. Thanks in advance. OK, I have two sources of data that provide date info in a csv file differently. I've attached a small zipped file with two text files that illustrate both. (Is it

Re: [R] Date conversions

2009-07-11 Thread Mark Knecht
On Sat, Jul 11, 2009 at 10:20 AM, Gabor Grothendieckggrothendi...@gmail.com wrote: No attachment appeared. I don't think the list allows zip files as attachments. Try plain text. On Sat, Jul 11, 2009 at 1:10 PM, Mark Knechtmarkkne...@gmail.com wrote: Hi all,   I'm having a little bit of

Re: [R] Date conversions

2009-07-11 Thread Gabor Grothendieck
No attachment appeared. I don't think the list allows zip files as attachments. Try plain text. On Sat, Jul 11, 2009 at 1:10 PM, Mark Knechtmarkkne...@gmail.com wrote: Hi all,   I'm having a little bit of trouble with some date conversions and am hoping someone can help me out. Thanks in

[R] mann-whitney U-test - U-value

2009-07-11 Thread Martin Batholdy
Hi, I know that I can perform a Mann-Whitney U test with wilcox.test(x,y) But instead of an U-value I get a W-Value. Is it possible to change this? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] mann-whitney U-test - U-value

2009-07-11 Thread milton ruser
Martin, If I am not wrong the difference is that if you has two levels you get U-test, and W-test for more than two levels. But the test is almost the same. cheers milton On Sat, Jul 11, 2009 at 2:13 PM, Martin Batholdy batho...@googlemail.comwrote: Hi, I know that I can perform a

Re: [R] mann-whitney U-test - U-value

2009-07-11 Thread Ted Harding
On 11-Jul-09 18:13:29, Martin Batholdy wrote: Hi, I know that I can perform a Mann-Whitney U test with wilcox.test(x,y) But instead of an U-value I get a W-Value. Is it possible to change this? The usual definition of the Man-Whitney U test for two samples x of size m) and y (of size n) is

Re: [R] Date conversions

2009-07-11 Thread Gabor Grothendieck
You want %Y, not %y. You might also want to look at the zoo package: library(zoo) z - read.zoo(Date1.txt, header = TRUE, sep = ,, format = %m/%d/%Y) or using chron: library(zoo) library(chron) z - read.zoo(Date1.txt, header = TRUE, sep = ,, FUN = as.chron) There are three vignettes that come

Re: [R] Date conversions

2009-07-11 Thread Mark Knecht
On Sat, Jul 11, 2009 at 12:05 PM, Gabor Grothendieckggrothendi...@gmail.com wrote: You want %Y, not %y. You might also want to look at the zoo package: library(zoo) z - read.zoo(Date1.txt, header = TRUE, sep = ,, format = %m/%d/%Y) or using chron: library(zoo) library(chron) z -

Re: [R] Date conversions

2009-07-11 Thread Gabor Grothendieck
Try: format(d, %a) or format(d, %A) or as.POSIXlt(d)$wday There is also day.of.week in chron. On Sat, Jul 11, 2009 at 3:42 PM, Mark Knecht markkne...@gmail.com wrote: On Sat, Jul 11, 2009 at 12:05 PM, Gabor Grothendieckggrothendi...@gmail.com wrote: You want %Y, not %y. You might also

Re: [R] Date conversions

2009-07-11 Thread Mark Knecht
Thanks. Will do. Cheers, Mark On Sat, Jul 11, 2009 at 12:49 PM, Gabor Grothendieckggrothendi...@gmail.com wrote: Try: format(d, %a) or format(d, %A) or as.POSIXlt(d)$wday There is also day.of.week in chron. On Sat, Jul 11, 2009 at 3:42 PM, Mark Knecht markkne...@gmail.com wrote: On Sat,

[R] Reading data entered within an R program

2009-07-11 Thread Muenchen, Robert A (Bob)
Dear R-helpers, I know of two ways to reading data within an R program, using textConnection and stdin (demo program below). I've Googled about and looked in several books for comparisons of the two approaches but haven't found anything. Are there any particular advantages or disadvantages to

Re: [R] t-scores and correlation

2009-07-11 Thread William Revelle
Adrian and Jorge, Try either rcorr in the Hmisc package or corr.test in the psych package. They both will give you a matrix of correlations as well as the p values of the correlations. Bill At 4:38 PM -0400 7/10/09, Jorge Ivan Velez wrote: Hi Adrian, Using cor.test you need either two

Re: [R] Reading data entered within an R program

2009-07-11 Thread milton ruser
*hum* I prefer stdin() because you not need to explain to your student or beginners about TextConnection. cheers milton On Sat, Jul 11, 2009 at 4:38 PM, Muenchen, Robert A (Bob) muenc...@utk.eduwrote: Dear R-helpers, I know of two ways to reading data within an R program, using

Re: [R] Reading data entered within an R program

2009-07-11 Thread Gabor Grothendieck
Both will work if you copy and paste directly into an R session but textConnection has the advantage that you can place it in a file and source it and it still works. On Sat, Jul 11, 2009 at 4:38 PM, Muenchen, Robert A (Bob) muenc...@utk.eduwrote: Dear R-helpers, I know of two ways to reading

Re: [R] drawing hmms

2009-07-11 Thread Greg Snow
Look at the subplot function in the TeachingDemos package. Does that do what you want? From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of rajesh j [akshay.raj...@gmail.com] Sent: Friday, July 10, 2009 2:04 AM To: milton ruser

Re: [R] How to Populate List

2009-07-11 Thread Rolf Turner
On 10/07/2009, at 5:25 PM, Gaurav Kumar wrote: Hi Rolf, My apologies for the inconvenience caused due to my reply @ R- help diges. Thanks for providing me a clue to solve the problem . I modify a bit to populate a list. This is throwing an error # Error in `*tmp*`[[j]] : subscript

Re: [R] Reading data entered within an R program

2009-07-11 Thread Muenchen, Robert A (Bob)
Since stdin seemed simpler I figured textConnection must have some advantage. Thanks! Bob From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: Saturday, July 11, 2009 6:00 PM To: Muenchen, Robert A (Bob) Cc: R-help@r-project.org Subject: Re: [R] Reading data entered within an

Re: [R] plm Issues

2009-07-11 Thread spencerg
Your script ran for me without error under the following configuration: sessionInfo() R version 2.9.1 (2009-06-26) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United

[R] strata -- really slow performance

2009-07-11 Thread Jonathan Greenberg
I'm a bit confused why the following command is taking an extrodinarily long time ( 2-3 hours) to run on an 3.06ghz iMac (brand new). I'm trying to do a stratified random sample, drawing only a single value per UniqueID from the patch_summary data frame: uniqueids -

Re: [R] nls, reach limit bounds

2009-07-11 Thread spencerg
Have you plotted the data? There are two standard sources of non-convergence problems like this: First, there may not be enough information in your data to estimate all four parameters. Second, if that's not the case, then your starting values are not appropriate. I routinely

Re: [R] plm Issues

2009-07-11 Thread milton ruser
The first think one need to do when has a so old version, is update it :-) After, if the problem remain, try get help with the colleagues. best milton On Thu, Jul 9, 2009 at 10:58 AM, Damien Moore damienlmo...@gmail.comwrote: Hi List I'm having difficulty understanding how plm should work