[R] HOW TO PASS MY JAVA ARGUMENT INTO RSCRIPT FILE

2011-10-09 Thread janarthanan murugesan
Hi , I am working in Eclipse IDE , I want to use rscript to produce statistical analysis , I tested a sample rcode in the script its working fine in my Eclipse IDE , but I don't know how to pass my java values into rscript . I need some guidance ,Please help me . Thanks , Janarthanan .M

Re: [R] ANOVA from imported data has only 1 degree of freedom

2011-10-09 Thread shardman
Hi David, Apologies again and thankyou for your help, I've edited my original post to clarify what I was asking. What I meant was that the factor had only 1 degrees of freedom when it should have had 2 (14 in total), so you're right there were 14 but not in the right place. In SPSS you select one

Re: [R] General help - online statistics courses?

2011-10-09 Thread kanishkporwal
You should try http://math.tutorvista.com/statistics.html Tutorvista.com the site offers http://math.tutorvista.com/statistics.html online statistics help to anyone that is in need. The site is very interactive and helps you get the ace in your desired subject. -- View this message in conte

Re: [R] HWEBayes, swapping the homozygotes genotype frequencies

2011-10-09 Thread Aaron Mackey
Without really knowing this code, I can guess that it may be the "triangular" prior at work. Bayes Factors are notorious for being sensitive to the prior. Presumably, the prior somehow prefers to see the rarer allele as the "BB", and not the "AA" homozygous genotype (this is a common assumption:

Re: [R] fast or space-efficient lookup?

2011-10-09 Thread Steve Lianoglou
Hi Ivo, I'll just be brief, but regarding data.table's syntax: one person's "strange" is another's "intuitive" :-) Note also that data.table also provides a `merge.data.table` function which works pretty much as you expect merge.data.frame to. The exception being that its `by` argument will, by d

Re: [R] fast or space-efficient lookup?

2011-10-09 Thread ivo welch
hi patrick. thanks. I think you are right.. combined <- merge( main, aggregate.data, by="day", all.x=TRUE, all.y=FALSE ) lm( stockreturn ~ marketreturn, data=combined ) becomes something like main <- as.data.table(main) setkey(main, "mmdd") aggregate.data <- as.data.table(aggregate.data) s

Re: [R] ANOVA from imported data has only 1 degree of freedom

2011-10-09 Thread Ben Bolker
shardman hotmail.com> writes: > > Hi, > > I'm trying to analyse some data I have imported into R from a .csv file but > when I carry out the aov command the results show only one degree of freedom > when there should be 14. Does anyone know why? I'd really appreciate some > help, the data is pa

Re: [R] variable name question

2011-10-09 Thread Deepankar Basu
Thanks for both comments. Indeed the sep = "" is needed. On Sun, Oct 9, 2011 at 9:43 PM, Rolf Turner wrote: > On 10/10/11 04:53, R. Michael Weylandt wrote: > > > > Try this: >> >> for (i in 1990:2009) { >> varName = paste("pci", i, collapse = "") >> assign(varName, log(get(varName)) >>

Re: [R] variable name question

2011-10-09 Thread Rolf Turner
On 10/10/11 04:53, R. Michael Weylandt wrote: Try this: for (i in 1990:2009) { varName = paste("pci", i, collapse = "") assign(varName, log(get(varName)) } I believe that ``sep= " '' is needed here rather than collapse. Try: paste("junk",42,collapse="") You get [1]

[R] Mittag-Leffler function

2011-10-09 Thread Eric Ferreira
Dear colleagues, Do you know any R code implemented for the Mittag-Leffler function (generalisation of the exponential function, fractional calculus) ? Thanks in advance, -- Dr Eric B Ferreira Exact Sciences Department Federal University of Alfenas Brazil [[alternative HTML version del

Re: [R] expression set (Bioconductor) problem

2011-10-09 Thread Juliet Hannah
Note that exprs returns a matrix, so we can manipulate that just as we would for any other type of matrix. There is also a Bioconductor mailing list, which may be helpful. On Thu, Oct 6, 2011 at 4:56 AM, Clayton K Collings wrote: > Hello R people, > >>dim(exprs(estrogenrma) > > I have an expressi

Re: [R] Connecting points over missing observations in Lattice

2011-10-09 Thread Gabor Grothendieck
On Sat, Oct 8, 2011 at 5:59 AM, Allan Sikk wrote: > Hello, > > I'm trying to plot connected time series of two variables in a lattice plot: > xyplot(y1 + y2 ~ t,  data=size, type="b") > > y2 has missing data for some of the observations and some points are > therefore not connected. It would make

Re: [R] Bartlett's Test of Sphericity

2011-10-09 Thread Fernando Henrique Ferraz Pereira da Rosa
You could also check this function I implemented awhile back: http://www.fernandohrosa.com.br/en/P/sphericity-test-for-covariance-matrices-in-r-sphericity-test/ On Fri, Jun 17, 2011 at 4:43 PM, thibault grava wrote: > Hello Dear R user, > > I want to conduct a Principal components analysis and I

Re: [R] Multiple levelplot with title

2011-10-09 Thread Carlos Ortega
Hi, Use function ltext() instead, also available in lattice package. Regards, Carlos Ortega www.qualityexcellence.es On Sun, Oct 9, 2011 at 6:30 PM, Richard O. Legendi < richard.lege...@gmail.com> wrote: > Hi all, > > I'm new to R and to the mailing list, so please bear with me :-) > > I would

Re: [R] ANOVA from imported data has only 1 degree of freedom

2011-10-09 Thread David Winsemius
On Oct 9, 2011, at 2:08 PM, shardman wrote: Hi David, Thanks for your message. I can assure you this is not homework. I'm working on an ecology project and am trying to analyse the results from the fieldwork. I don't want other people to do the work for me I was just hoping someone might

Re: [R] barplots

2011-10-09 Thread Carlos Ortega
Hi, Another way to do that is with function barchart() in package lattice. Barchart requires a function which relates your variables with the option to specify groups. Check the examples (are under xyplot help) to apply them to your case. Regards, Carlos Ortega www.qualityexcellence.es On Thu,

Re: [R] ANOVA from imported data has only 1 degree of freedom

2011-10-09 Thread shardman
Hi David, Thanks for your message. I can assure you this is not homework. I'm working on an ecology project and am trying to analyse the results from the fieldwork. I don't want other people to do the work for me I was just hoping someone might be able to spot where I have made a mistake, I'm sti

Re: [R] variable name question

2011-10-09 Thread David Winsemius
On Oct 9, 2011, at 2:24 PM, Carlos Ortega wrote: Hello, In R you just need to take the log of the whole whole data.frame where you have your pci* and store in a new variable. You do not need to use a "for" loop: log.df <- log(your_data_frame) Possibly with a selection for the column name

Re: [R] two-dimensional Kolmogorov-Smirnow (2DKS) test

2011-10-09 Thread David Winsemius
On Oct 9, 2011, at 1:46 PM, beaulieu.j...@epamail.epa.gov wrote: The reference below describes the utility of the two-dimensional Kolmogorov-Smirnow (2DKS) test for detecting relationships in bivariate data. If this test has been implemented in R I would love to know about it! I have n

Re: [R] variable name question

2011-10-09 Thread Carlos Ortega
Hello, In R you just need to take the log of the whole whole data.frame where you have your pci* and store in a new variable. You do not need to use a "for" loop: log.df <- log(your_data_frame) Regards, Carlos Ortega www.qualityexcellence.es On Sun, Oct 9, 2011 at 5:34 PM, deepankar wrote: >

Re: [R] apply to a matrix and insert in the middle of an array

2011-10-09 Thread David Winsemius
On Oct 9, 2011, at 1:04 PM, Maas James Dr (MED) wrote: If possible I'd like to produce a function that applies a formula to a column in a matrix (essentially calculating the mse) and then inserts it between values of a an array ... confusing I know, here is an example of what I'm trying to

[R] two-dimensional Kolmogorov-Smirnow (2DKS) test

2011-10-09 Thread Beaulieu . Jake
The reference below describes the utility of the two-dimensional Kolmogorov-Smirnow (2DKS) test for detecting relationships in bivariate data. If this test has been implemented in R I would love to know about it! Thanks, jake Garvey, J. E., E.A. Marschall, and R.A. Wright (1998). "From star

Re: [R] fast or space-efficient lookup?

2011-10-09 Thread Patrick Burns
I think you are looking for the 'data.table' package. On 09/10/2011 17:31, ivo welch wrote: Dear R experts---I am struggling with memory and speed issues. Advice would be appreciated. I have a long data set (of financial stock returns, with stock name and trading day). All three variables, st

[R] Problem with twitteR package

2011-10-09 Thread Steven Oliver
Hey Guys, I just started fooling around with the twitteR package in order to get a record of all tweets from a single public account. When I run userTimeline, I get the default 20 most recent tweets just fine. However, when I specify an arbitrary number of tweets (as described in the documentat

Re: [R] ANOVA from imported data has only 1 degree of freedom

2011-10-09 Thread David Winsemius
On Oct 9, 2011, at 11:10 AM, shardman wrote: Hi, I'm trying to analyse some data I have imported into R from a .csv file but when I carry out the aov command the results show only one degree of freedom when there should be 14. Does anyone know why? I'd really appreciate some help, the d

[R] apply to a matrix and insert in the middle of an array

2011-10-09 Thread Maas James Dr (MED)
If possible I'd like to produce a function that applies a formula to a column in a matrix (essentially calculating the mse) and then inserts it between values of a an array ... confusing I know, here is an example of what I'm trying to accomplish: ## create a matrix (a <- matrix(c(3,6,4,8,5,9,1

Re: [R] Substract "previous" element

2011-10-09 Thread Alaios
Thanks a lot for the help From: Jeff Newmiller Sent: Sunday, October 9, 2011 6:35 PM Subject: Re: [R] Substract "previous" element Vectors are not matrices in R, though matrices are special cases of vectors. See ?diff for a solution that works with vectors.

Re: [R] Permutation or Bootstrap to obtain p-value for one sample

2011-10-09 Thread francesca casalino
Dear Peter and Tim, Thank you very much for taking the time to explain this to me! It is much more clear now. And sorry for using the space here maybe inappropriately, I really hope this is OK and gets posted, I think it is really important that non-statisticians like myself get a good idea of the

Re: [R] cuhre usage ?? multidimensional integration

2011-10-09 Thread R. Michael Weylandt
Have you taken a look at the provided introductory materials? type help.start() to get "An Introduction to R" which I believe is provided as a part of every pre-packaged version of R so it's most likely already on your machine. Read that and then we can sort through how to correctly implement your

[R] variable name question

2011-10-09 Thread deepankar
Hi All, This is surely an easy question but somehow I am not being able to get it. I am using R 2.13.2 and have a data set where variable names like this appear: pci1990, pci1991, ... , pci2009. "pci1990" has data on per capita income for 1990, "pci1991" has data on per capita income for 19

Re: [R] Permutation or Bootstrap to obtain p-value for one sample

2011-10-09 Thread Tim Hesterberg
I'll concur with Peter Dalgaard that * a permutation test is the right thing to do - your problem is equivalent to a two-sample test, * don't bootstrap, and * don't bother with t-statistics but I'll elaborate a bit on on why, including * two approaches to the whole problem - and how your approa

[R] ANOVA from imported data has only 1 degree of freedom

2011-10-09 Thread shardman
Hi, I'm trying to analyse some data I have imported into R from a .csv file but when I carry out the aov command the results show only one degree of freedom when there should be 14. Does anyone know why? I'd really appreciate some help, the data is pasted below. /The imported table looks ike thi

[R] Multiple levelplot with title

2011-10-09 Thread Richard O. Legendi
Hi all, I'm new to R and to the mailing list, so please bear with me :-) I would like to create multiple levelplots on the same chart with a nice main title with something like this: print(levelplot(matrix(c(1,2,3,4), 2, 2)), split=c(1, 1, 2, 1)) print(levelplot(matrix(c(1,2,3,4), 2, 2)),

Re: [R] convert apply to lappy

2011-10-09 Thread Joshua Wiley
Hi Alex, If "data" is a matrix, probably the easiest option would be: tips <- as.data.frame(data) mclapply(tips, foo) By the way, I would recommend not using 'data' (which is also a function) as the name of the object storing your data. If your data set has many columns and performance is an i

[R] fast or space-efficient lookup?

2011-10-09 Thread ivo welch
Dear R experts---I am struggling with memory and speed issues. Advice would be appreciated. I have a long data set (of financial stock returns, with stock name and trading day). All three variables, stock return, id and day, are irregular. About 1.3GB in object.size (200MB on disk). now, I nee

Re: [R] variable name question

2011-10-09 Thread R. Michael Weylandt
"This is surely an easy question but somehow I am not being able to get it." get() is the key -- it takes a string and returns the object with that string as its name. Assign() goes the other way Try this: for (i in 1990:2009) { varName = paste("pci", i, collapse = "") assign(varName, lo

[R] convert apply to lappy

2011-10-09 Thread Alaios
Dear all I want to convert a apply to lapply. The reason for that is that there is a function mclappy that uses exact the same format as the lapply function. My code looks like that mean_power_per_tip <- function(data) {     return((apply(data[,],2,MeanTip))); } where data is a [m,n] matrix

[R] variable name question

2011-10-09 Thread Deepankar Basu
Hi All, This is surely an easy question but somehow I am not being able to get it. I am using R 2.13.2 and have a data set where variable names like this appear: pci1990, pci1991, ... , pci2009. "pci1990" has data on per capita income for 1990, "pci1991" has data on per capita income for 1991,

Re: [R] Substract "previous" element

2011-10-09 Thread Jeff Newmiller
Vectors are not matrices in R, though matrices are special cases of vectors. See ?diff for a solution that works with vectors. --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead:

Re: [R] Substract "previous" element

2011-10-09 Thread R. Michael Weylandt
Take a look at diff() though offhand I dont know what it does to matrices M On Oct 9, 2011, at 11:00 AM, Alaios wrote: > Dear all, > I have a matrix with data and I want to substract from every value the > previous element. > > Let's assume that my vector(matrix) is c<-(1,2,3,4,5) > I want to

Re: [R] axes3d/bbox3d - axis values not fixed

2011-10-09 Thread Ben qant
Excellent! Thank you! Ben On Sat, Oct 8, 2011 at 3:36 PM, Duncan Murdoch wrote: > On 11-10-08 11:04 AM, Ben qant wrote: > >> Thank you! >> >> Sorry, I have a couple more questions: >> 1) How to I turn off the box shading completely? I figured out how to >> lighten it up to a grey color with col=

Re: [R] Generalized Additive Models: How to create publication-ready regression tables

2011-10-09 Thread Frank Harrell
In many cases a flexible parametric fit, using regression splines, will result in a fit that is as good as a gam, with similar regression shapes. The rms package has a latex method that will represent such fits in interpretable algebraic form. latex(fit) does that, and print(fit, latex=TRUE) will

[R] Substract "previous" element

2011-10-09 Thread Alaios
Dear all, I have a matrix with data and I want to substract from every value the previous element. Let's assume that my vector(matrix) is c<-(1,2,3,4,5) I want to get remove_previous c<-(0,1,2,3,4). How I can do that efficiently in R? I would like to thank you in advance for your help B.R Alex

Re: [R] strucchange Nyblom-Hansen Test?

2011-10-09 Thread Achim Zeileis
On Sun, 9 Oct 2011, buehlerman wrote: I want to apply Nyblom-Hansen test with the strucchange package, but I don't know how is the correct way and what is the difference between the following two approaches (leeding to different results): The difference is that sctest(formula, type = "Nyblom-

Re: [R] Permutation or Bootstrap to obtain p-value for one sample

2011-10-09 Thread Bert Gunter
I may be speaking out of turn here, but I would prefer not to see R-help turn into a tutorial site for basic statistics.Such sites already exist (e.g. http://stats.stackexchange.com/). I realize that there is occasionally reason to venture down this path a way within legitimate R contexts, but thi

[R] pdIdent in smoothing regression model

2011-10-09 Thread Lei Liu
Hi there, I am reading the 2004 paper "Smoothing with mixed model software" in Journal of Statistical Software, by Ngo and Wand. I tried to run their first example in Section 2.1 using R but I had some problems. Here is the code: library(nlme) fossil <- read.table("fossil.dat",header=T) x <-

Re: [R] Finding solution

2011-10-09 Thread Bert Gunter
R is not the right tool for all things. This looks like a job for a computer algebra system. That said, R **does** have at least one interface to such a system. See the Ryacas package (check my capitalization, which may be wrong). HelpeRs may provide you with others. -- Bert On Sun, Oct 9, 2011

Re: [R] Permutation or Bootstrap to obtain p-value for one sample

2011-10-09 Thread francesca casalino
Thank you very much to both Ken and Peter for the very helpful explanations. Just to understand this better (sorry for repeating but I am also new in statistics…so please correct me where I am wrong): Ken' method: Random sampling of the mean, and then using these means to construct a distribution

[R] strucchange Nyblom-Hansen Test?

2011-10-09 Thread buehlerman
I want to apply Nyblom-Hansen test with the strucchange package, but I don't know how is the correct way and what is the difference between the following two approaches (leeding to different results): data("longley") # 1. Approach: sctest(Employed ~ Year + GNP.deflator + GNP + Armed.Forces, data

Re: [R] Permutation or Bootstrap to obtain p-value for one sample

2011-10-09 Thread peter dalgaard
On Oct 9, 2011, at 12:00 , francesca casalino wrote: > Thank you very much to both Ken and Peter for the very helpful explanations. > > Just to understand this better (sorry for repeating but I am also new in > statistics…so please correct me where I am wrong): > > Ken' method: > Random sampl

Re: [R] Finding solution

2011-10-09 Thread peter dalgaard
On Oct 9, 2011, at 14:02 , Bogaso Christofer wrote: > Dear all, I have a system of simultaneous equations with 2 unknowns as > follows: > > > > x*y + (1-x) = 0.05 > > x*(y - .5)^2 + (1-x)*0.6 = 0.56^2 > > > > Ofcourse I can do it manually however wondering whether there is any direct > way

[R] Finding solution

2011-10-09 Thread Bogaso Christofer
Dear all, I have a system of simultaneous equations with 2 unknowns as follows: x*y + (1-x) = 0.05 x*(y - .5)^2 + (1-x)*0.6 = 0.56^2 Ofcourse I can do it manually however wondering whether there is any direct way in R available to get the solution of this system? Thanks and regards,

[R] help with statistics in R - how to measure the effect of users in groups

2011-10-09 Thread gj
Hi, I'm a newbie to R. My knowledge of statistics is mostly self-taught. My problem is how to measure the effect of users in groups. I can calculate a particular attribute for a user in a group. But my hypothesis is that the user's attribute is not independent of each other and that the user's att

Re: [R] Generalized Additive Models: How to create publication-ready regression tables

2011-10-09 Thread Emilio López
You may "build" your customized matrix merging the components of the objects before calling the xtable function: my.matrix <- rbind(model$coefficients, [vector containing errors]) xtable(my.matrix) (I'm sorry I don't know exactly where the standard errors are stored / how to compute them) You can

Re: [R] round() and negative digits

2011-10-09 Thread Prof Brian Ripley
On Sat, 8 Oct 2011, Duncan Murdoch wrote: On 11-10-07 5:26 PM, Carl Witthoft wrote: Just wondering here -- I tested and found to my delight that % round(325.4,-2) [1] 300 gave me exactly what I would have expected (and wanted). Since it's not explicitly mentioned in the documentation that n

Re: [R] round() and negative digits

2011-10-09 Thread Duncan Murdoch
On 11-10-09 4:00 AM, (Ted Harding) wrote: On 09-Oct-11 00:46:58, Carl Witthoft wrote: On 10/8/11 6:11 PM, (Ted Harding) wrote: Carl Witthoft's serendipitous discovery is a nice example of how secrets can be guessed by wondering "what if ... ?". So probably you don;t need to tell the secrets.

Re: [R] help with using last observation carried forward analysis for a clinical trial please

2011-10-09 Thread David Winsemius
On Oct 8, 2011, at 8:43 PM, maspitze wrote: Hi, I have a series of id's with multiple visits and questionnaire scores. This is a clinical trial that will be analyzed using the last observation carried forward method. In other words, in order to comply with intent to treat analysis when

Re: [R] sapply(pred,cor,y=resp)

2011-10-09 Thread Joshua Wiley
Hi, It is probably more confusing with several steps combined, but you are correct that it is because there are NAs. It is fairly common for R functions to return NA if there are any NA values unless you explicitly set an argument on what to do with missing values. A quick look at ?cor clearly s

[R] sapply(pred,cor,y=resp)

2011-10-09 Thread William Claster
Hello. I am wondering why I am getting NA for all in cors=sapply(pred,cor,y=resp). I suppose that each column in pred has NAs in them. Is there some way to fix this? Thanks > str(pred) 'data.frame':   200 obs. of  13 variables:  $ mnO2: num  9.8 8 11.4 4.8 9 13.1 10.3 10.6 3.4 9.9 ...  $ Cl  :

Re: [R] round() and negative digits

2011-10-09 Thread Ted Harding
On 09-Oct-11 00:46:58, Carl Witthoft wrote: > > On 10/8/11 6:11 PM, (Ted Harding) wrote: > >> Carl Witthoft's serendipitous discovery is a nice example >> of how secrets can be guessed by wondering "what if ... ?". >> So probably you don;t need to tell the secrets. >> >> Taking the "negative digi

Re: [R] Permutation or Bootstrap to obtain p-value for one sample

2011-10-09 Thread peter dalgaard
On Oct 8, 2011, at 16:04 , francy wrote: > Hi, > > I am having trouble understanding how to approach a simulation: > > I have a sample of n=250 from a population of N=2,000 individuals, and I > would like to use either permutation test or bootstrap to test whether this > particular sample is s