Re: [R] quantmod package

2011-10-31 Thread ATANU
Dear Michael , Thanks for your help. I figured out the fault. Actually i was running the code for a very short time(less than one minute) and was then trying to make chart out of that. The code works well if I run it for more than one minute. Thanks again for your help. Atanu -- View this messag

[R] drawing ellipses in R

2011-10-31 Thread mmstat
Hello, I have been following the thread dated Monday, October 9, 2006 when Kamila Naxerova asked a question about plotting elliptical shapes. Can you explain the equations for X and Y. I believe they used the parametric form of x and y (x=r cos(theta), y=r sin(theta). I don't know what r is he

[R] low sigma in lognormal fit of gamlss

2011-10-31 Thread RdR
Hi, I'm playing around with gamlss and don't entirely understand the sigma result from an attempted lognormal fit. In the example below, I've created lognormal data with mu=10 and sigma=2. When I try a gamlss fit, I get an estimated mu=9.947 and sigma=0.69 The mu estimate seems in the ballpark,

Re: [R] Linear Regression with Linear Equality Constraint

2011-10-31 Thread Mehmet Suzen
I think Alabama package on CRAN can do this; http://cran.r-project.org/web/packages/alabama/index.html >-Original Message- >From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >On Behalf Of JW >Sent: 31 October 2011 17:57 >To: r-help@r-project.org >Subject: [R] Linear

Re: [R] low sigma in lognormal fit of gamlss

2011-10-31 Thread RdR
Actually, I think I've spotted it: the link function for sigma is "log" and exp(0.69) is nearly 2 -- the original sigma -RdR -- View this message in context: http://r.789695.n4.nabble.com/low-sigma-in-lognormal-fit-of-gamlss-tp3962480p3962487.html Sent from the R help mailing list archive at Nab

[R] (no subject)

2011-10-31 Thread Simon Kiss
Dear colleagues I'm using data that looks like .test and .test1 below to draw two mosaic plots with cell labelling (the row percentages from the tables). When I take out the pop=FALSE commands in the mosaic commands and comment out the two lines labelling the cells, then the plots are laid out e

[R] Multiple time series with zoo

2011-10-31 Thread Vinny Moriarty
Thanks for everyone's input so far, it is greatly appreciated. But I've got one last task I could use some advice on Here are the first few lines of my data set: site,time_local,time_utc,reef_type_code,sensor_type,sensor_depth_m,temperature_c 06,2006-04-09 10:20:00,2006-04-09 20:20:00,BAK,sb39,

Re: [R] Vectorize 'eol' characters

2011-10-31 Thread Comcast
On Oct 31, 2011, at 2:01 PM, "Stefano Conti" wrote: > Thanks to Dr Shepard and Prof Riply for their helpful replies. > > In my original query I should have also specified that I have tried the > trick, also suggested by Prof Ripley, of appending the extra-column to the > original matrix befo

Re: [R] oversampling code

2011-10-31 Thread Weidong Gu
You should figure out how many samples you want for Y=1 and 0, then sample from the relevant subset dfrm[dfrm$Y==1] by sampling row.names(dfrm[dfrm$Y==1] using replace=FALSE ?sample On Mon, Oct 31, 2011 at 8:18 PM, Comcast wrote: > > > On Oct 31, 2011, at 1:54 PM, loubna ibn majdoub hassani > w

Re: [R] lapply and Two TimeStamps as input

2011-10-31 Thread Pete Brecknock
alaios wrote: > > Dear all, > > I have a function that recognizes the following format for timestamps > "%Y-%m-%d %H:%M:%S" > > my function takes two input arguments the TimeStart and TimeEnd > I would like to help me create the right list with pairs of TimeStart and > TimeEnd which I can feed

Re: [R] oversampling code

2011-10-31 Thread Comcast
On Oct 31, 2011, at 1:54 PM, loubna ibn majdoub hassani wrote: > Hir > I have an umbalanced data set where I want to predict a binary variable Y. > I want to do an under sampling by keeping all the 1 and taking just some of > the 0 such as I'll have 90% of 0 and 10% of 1. ou haven' t given mu

Re: [R] lapply and Two TimeStamps as input

2011-10-31 Thread Comcast
Provide some sample data. For instance, a data frame with two columns and the function. On Oct 31, 2011, at 6:37 PM, Alaios wrote: > Dear all, > > I have a function that recognizes the following format for timestamps > "%Y-%m-%d %H:%M:%S" > > my function takes two input arguments the TimeSt

Re: [R] 3D Graph Surface and single points (eg wireframe with points)

2011-10-31 Thread Duncan Murdoch
On 11-10-31 6:11 PM, Karl Knoblick wrote: Hallo! I just want to make a 3D plot of a surface of a cone and want to plot some single points around. I tried wireframe but cannot find how to plot single points I tried scatterplot3d but there the surface is not simple to plot. And: How can I rota

[R] lapply and Two TimeStamps as input

2011-10-31 Thread Alaios
Dear all, I have a function that recognizes the following format for timestamps "%Y-%m-%d %H:%M:%S" my function takes two input arguments the TimeStart and TimeEnd I would like to help me create the right list with pairs of TimeStart and TimeEnd which I can feed to lapply (I am using mclapply ac

Re: [R] Plot two matrices and keeping the record of row names

2011-10-31 Thread Bansal, Vikas
Dear Peter, Thanks for your reply.I am familiar with this solution but I was trying to make the plot user friendly.I have seen some plots,in which if we keep a cursor on any point of plot,it will automatically shows you the row names.Is it possible? I did not find anything related to this. Tha

[R] 3D Graph Surface and single points (eg wireframe with points)

2011-10-31 Thread Karl Knoblick
Hallo!   I just want to make a 3D plot of a surface of a cone and want to plot some single points around.   I tried wireframe but cannot find how to plot single points   I tried scatterplot3d but there the surface is not simple to plot. And: How can I rotate the point of view by the z-axis   I tr

Re: [R] Plot two matrices and keeping the record of row names

2011-10-31 Thread Peter Alspach
Tena koe Vikas If I understand you correctly, you could generate a character matrix the elements of which are the row.names and col.names of x1 pasted together (perhaps with : as a separator). Then the upper.tri of this will give you the associations. HTH ... Peter Alspach > -Original M

Re: [R] Linear Regression with Linear Equality Constraint

2011-10-31 Thread Comcast
On Oct 31, 2011, at 5:12 PM, Comcast wrote: > > > On Oct 31, 2011, at 3:31 PM, Bert Gunter wrote: > >> Well, if I understand the question correctly (following the posting guide >> would have spared guessing, as usual), forget packages -- nothing more than >> elementary algebra is needed. >>

[R] Plot two matrices and keeping the record of row names

2011-10-31 Thread Bansal, Vikas
Dear all, I am having this trouble and posted this query before.Can you please help me. I have two matrices- x1 and y1 with same row names and column names(actually the names of the patients). x1 a bc de a 1.000 0.4730679 0.6226

Re: [R] Linear Regression with Linear Equality Constraint

2011-10-31 Thread Comcast
On Oct 31, 2011, at 3:31 PM, Bert Gunter wrote: > Well, if I understand the question correctly (following the posting guide > would have spared guessing, as usual), forget packages -- nothing more than > elementary algebra is needed. > > e.g. > > lm(y ~ x1 + x2 + x3) subject to the constrain

Re: [R] Randomized Points in space/ saving model results

2011-10-31 Thread R. Michael Weylandt
Comments inline: On Mon, Oct 31, 2011 at 1:51 AM, magono wrote: > Ok, to michael > Looking over what you posted I'm thinking this is the way forward but my > lack of experience using functions is getting in the way of accomplishing > the task.  Examining the outputs into the functions and puttin

Re: [R] Question on estimating standard errors with noisy signals using the quantreg package

2011-10-31 Thread Roger Koenker
On Oct 31, 2011, at 7:30 AM, Thorsten Vogel wrote: > Dear all, > > My question might be more of a statistics question than a question on R, > although it's on how to apply the 'quantreg' package. Please accept my > apologies if you believe I am strongly misusing this list. > > To be very brief

Re: [R] reshape2: Lost Values Between melt() and dcast() [SOLVED]

2011-10-31 Thread Rich Shepard
On Mon, 31 Oct 2011, Rich Shepard wrote: Curious how the database table has a value of 1.00 mg/L and the read data frame contains NA. More curious is why the cast() data frame has a '2' for that row. Further searching in emacs of the text file generated by write.text() I found two rows for

Re: [R] Significance of trend

2011-10-31 Thread R. Michael Weylandt
I'm thinking you need to read up on what a p-value is: https://secure.wikimedia.org/wikipedia/en/wiki/P-value Michael Weylandt On Mon, Oct 31, 2011 at 2:51 PM, Muhammad Rahiz wrote: > Hi everyone, > > I'm trying to determine the significance of a trendline. From my internet > search months ago,

Re: [R] how to remove the redundant rows of a matrix

2011-10-31 Thread R. Michael Weylandt
Your data didn't come through with the html stripping but either unique() or duplicated() should get you where you need to be. Michael On Mon, Oct 31, 2011 at 12:25 PM, yan liu wrote: > Hi, > > I have a matrix like this, two columns: a, b > >  a b  c1 21  c2 19  c2 20  c2 20  c4 25  c5 18  c5 18

[R] troubles installing R

2011-10-31 Thread Cable, Sam B Civ USAF AFMC AFRL/RVBXI
I am trying to install R on a pretty up-to-date CentOS system. I have tried installing 2.14.0 and 2.13.2. In both cases, the configure step fails, and does not produce a Makefile. So, of course, I can't issue "make". The errors that I can find in config.log are, first, several missing files: ac

[R] Equidistant time spacing of time series data

2011-10-31 Thread Ritz
I am running ARMA model on time series data. Data consists of price changes in S&P 500 during the day, recorded at 4 predefined time stamps( 8:30, 10:30,10:15, 3:12, hence non equidistant) My question is, do I need to worry about the data being non equidistant? If so, how do I modify my series t

Re: [R] Vectorize 'eol' characters

2011-10-31 Thread Stefano Conti
Thanks to Dr Shepard and Prof Riply for their helpful replies. In my original query I should have also specified that I have tried the trick, also suggested by Prof Ripley, of appending the extra-column to the original matrix before dumping to text; however, in cases where the field separator s

Re: [R] Linear Regression with Linear Equality Constraint

2011-10-31 Thread Bert Gunter
Well, if I understand the question correctly (following the posting guide would have spared guessing, as usual), forget packages -- nothing more than elementary algebra is needed. e.g. lm(y ~ x1 + x2 + x3) subject to the constraint beta_2 = beta_3, the coefficients of x2 and x3, is the same as

Re: [R] Linear Regression with Linear Equality Constraint

2011-10-31 Thread Kristian Lind
I believe the package systemfit can help you with that. Haven't tried it myself, but give it a go. Regards, Kristian 2011/10/31 JW > Please advice on the package I should use to run a linear regression model > (weighted least squared) with linear equality constraint. I initially > tried > "co

Re: [R] oversampling code

2011-10-31 Thread Weidong Gu
For a data set dat with variable 'case', it follows sam.rate=0.9 n.ctrl<-nrow(dat[dat$case==0,]) sam.ctrl<-dat[sample(row.names(dat[dat$case==0],n.ctrl*sam.rate,replace=F),] rbind(dat[dat$case==1,],sam.ctrl) Weidong Gu On Mon, Oct 31, 2011 at 1:54 PM, loubna ibn majdoub hassani wrote: > Hi > I

[R] Significance of trend

2011-10-31 Thread Muhammad Rahiz
Hi everyone, I'm trying to determine the significance of a trendline. From my internet search months ago, I came across the following post. I modified tim and dat for simiplicity. tim <- 1:10 dat <- c(0.17, 1.09 ,0.11, 0.82, 0.23, 0.38 ,2.47 ,0.41 ,0.75, 1.44) fstat <- summary(lm(dat~tim))$fsta

Re: [R] googleVis motionchart - slow with Date class

2011-10-31 Thread Gesmann, Markus
Hi Matt, In general my first approach would be to contact the package maintainer/author with questions. The World Bank example with monthly data runs quite smoothly on my PC using Windows XP and IE7. However, I can see that the performance deteriorates compared to the original demo. The gvisM

Re: [R] reshape2: Lost Values Between melt() and dcast()

2011-10-31 Thread Rich Shepard
On Mon, 31 Oct 2011, Justin Haynes wrote: I'd look at the outputs of those two dcast calls and find cells where the length is > 1. Those are duplicated entries in your initial data.frames (when I've run into this is was usually due to NA values somewhere unexpected). The dcast() resulting d

[R] Kaplan Meier - not for dates

2011-10-31 Thread Polwart Calum (COUNTY DURHAM AND DARLINGTON NHS FOUNDATION TRUST)
I have some data which is censored and I want to determine the median. Its actually cost data for a cohort of patients, many of whom are still on treatment and so are censored. I can do the same sort of analysis for a survival curve and get the median survival... ...but can I just use the surv

[R] oversampling code

2011-10-31 Thread loubna ibn majdoub hassani
Hi I have an umbalanced data set where I want to predict a binary variable Y. I want to do an under sampling by keeping all the 1 and taking just some of the 0 such as I'll have 90% of 0 and 10% of 1. Can u help me do that Thank u [[alternative HTML version deleted]] _

[R] Linear Regression with Linear Equality Constraint

2011-10-31 Thread JW
Please advice on the package I should use to run a linear regression model (weighted least squared) with linear equality constraint. I initially tried "constrOptim" but it turned out that it only supported inequality linear constraint. Thank you very much in advance. Cheers, Jon -- View this m

Re: [R] How to show classes with 0 count in table()?

2011-10-31 Thread Leonardo Bergamini
Thanks you all. 2011/10/31 Leonardo Bergamini > I need a table showing even the zero counts. > > x<-c(1,1,1,2,2,2,5,5,5) > table(x) > x > 1 2 5 > 3 3 3 > > > How can I get this: > > x > 1 2 3 4 5 > 3 3 0 0 3 > > Thanks, > > > > [[alternative HTML version deleted]] ___

Re: [R] reshape2: Lost Values Between melt() and dcast()

2011-10-31 Thread Rich Shepard
On Mon, 31 Oct 2011, Justin Haynes wrote: However, the dcast calls that "failed" can be helpful for determining the source of your error. I'd look at the outputs of those two dcast calls and find cells where the length is > 1. Those are duplicated entries in your initial data.frames (when I've

Re: [R] reshape2: Lost Values Between melt() and dcast()

2011-10-31 Thread Justin Haynes
The reason dcast would give that warning (not a failure) is if the formula you gave did not specify unique values. Thus, dcast needs an aggregating function, which defaults to length. However, the dcast calls that "failed" can be helpful for determining the source of your error. I'd look at the

Re: [R] unset proxy in R

2011-10-31 Thread Prof Brian Ripley
On Mon, 31 Oct 2011, carol white wrote: My apologies for having interfered with an existing thread. Any other proposition to unset the proxy in R is welcome. Please do follow the posting guide: we are lacking the 'at a minimum' information requested (not for the first, second, third ... time

Re: [R] Function input for regression analysis

2011-10-31 Thread Bert Gunter
I should have said: See also ?model.matrix -- Bert On Mon, Oct 31, 2011 at 9:00 AM, flokke wrote: > I know the lm() function, but I'd like to make my 'own' regression analysis > by using matrix algebra. > Thats why I wrote the function, > but I dont know what values to pick to make it suitable

Re: [R] Function input for regression analysis

2011-10-31 Thread Bert Gunter
Well, this just shows how much you don't understand. There is A LOT under the hood here, extending back to work in the 70's (Wilkinson and Rogers (1973) "Symbolic description of factorial models for analysis of variance" ) and probably before. See also McCullagh and Nelder's "Generalized Linear Mo

Re: [R] Vectorize 'eol' characters

2011-10-31 Thread Prof Brian Ripley
On Mon, 31 Oct 2011, Stefano Conti wrote: Dear R users, When dumping an R matrix object into a file -- typically via the 'write.table' function -- the 'eol' option can be used to specify the end-of-line character(s) which should appear at the end of each row. However the argument to 'eol'

Re: [R] assignment operator <- does not work in a function...

2011-10-31 Thread Bert Gunter
"assignment operator <- does not work in a function..." Of course not! Read the docs (e.g. "An Introduction to R", especially the part on writing functions) Also: ?"<<-" -- Bert On Mon, Oct 31, 2011 at 9:22 AM, Mehmet Suzen wrote: > Are you running the function with Rscript or R CMD? If yes,

Re: [R] unset proxy in R

2011-10-31 Thread carol white
My apologies for having interfered with an existing thread. Any other proposition to unset the proxy in R is welcome. Cheers, Carol - Original Message - From: peter dalgaard To: carol white Cc: "r-h...@stat.math.ethz.ch" Sent: Monday, October 31, 2011 1:44 PM Subject: Re: [R] unset

[R] reshape2: Lost Values Between melt() and dcast()

2011-10-31 Thread Rich Shepard
Working with 5 subset streams from my source data frame, three of them successfully call dcast(), but two fail: jerritt.cast <- dcast(jerritt.melt, site + sampdate ~ param) Aggregation function missing: defaulting to length and winters.cast <- dcast(winters.melt, site + sampdate ~ param) Aggr

[R] Vectorize 'eol' characters

2011-10-31 Thread Stefano Conti
Dear R users, When dumping an R matrix object into a file -- typically via the 'write.table' function -- the 'eol' option can be used to specify the end-of-line character(s) which should appear at the end of each row. However the argument to 'eol' seems to be restricted to have length 1, wherea

Re: [R] Function input for regression analysis

2011-10-31 Thread flokke
I know the lm() function, but I'd like to make my 'own' regression analysis by using matrix algebra. Thats why I wrote the function, but I dont know what values to pick to make it suitable for every dataset. If I pick a statistical model like lm(y~x) as input, the function would not know what o

[R] googleVis motionchart - slow with Date class

2011-10-31 Thread Matt Pocernich
Hi, I am trying to create a googleVis motion chart with monthly data. When formatting the date column as a Date class variable, the plot as presented in the browser becomes considerably slower and very prone to crashing the browser. To illustrate this issue I have modified the WorldBank demo

Re: [R] Persp3d default view

2011-10-31 Thread playballa23
http://r.789695.n4.nabble.com/file/n3956027/myplot.png -- View this message in context: http://r.789695.n4.nabble.com/Persp3d-default-view-tp3956000p3956027.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

[R] Persp3d default view

2011-10-31 Thread playballa23
Is there a way to default the view of the graph to a certain angle depending on a data set? If my z values are increasing, can I have the graph open up to an optimal way of viewing it, instead of actually turning the graph? How about if my z values are decreasing? -- View this message in context

[R] Help combining cell labelling and multiple mosaic plots

2011-10-31 Thread Simon Kiss
Dear colleagues I'm using data that looks like .test and .test1 below to draw two mosaic plots with cell labelling (the row percentages from the tables). When I take out the pop=FALSE commands in the mosaic commands and comment out the two lines labelling the cells, then the plots are laid out e

Re: [R] one sample Wilcoxon test using 'coin'

2011-10-31 Thread Holger Taschenberger
On Mon, 31 Oct 2011 09:14:15 -0700 (PDT) Mark Lamias wrote: > The wilcoxon test in coin are meant only for "Testing the equality of > the distributions of a numeric response in *two or more* independent > groups against shift alternatives" whereas the wilcoxon test in the > base pacakge "Perform

[R] how to remove the redundant rows of a matrix

2011-10-31 Thread yan liu
Hi, I have a matrix like this, two columns: a, b a b c1 21 c2 19 c2 20 c2 20 c4 25 c5 18 c5 18 how to prepare a new matrix removing the rows with repeated units in b columns, like there are two 20 and two 18 in b column (others are unique in b col). I wanna a pure matrix with one 20 and

Re: [R] assignment operator <- does not work in a function...

2011-10-31 Thread Mehmet Suzen
Are you running the function with Rscript or R CMD? If yes, try it interactively. Or, try to run them separate functions. >-Original Message- >From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >On Behalf Of Levent TERLEMEZ >Sent: 31 October 2011 13:31 >To: r-help@r

[R] Plot two matrices and keeping the record of row names

2011-10-31 Thread Bansal, Vikas
Dear all, I have two data frames- x1 and y1 with same row names and column names(actually the names of the patients). x1 a bc de a 1.000 0.4730679 0.6226994 0.6036036 0.643 b 0.4730679 1.000 0.6227273 0.6303855 0.5730858

Re: [R] one sample Wilcoxon test using 'coin'

2011-10-31 Thread Mark Lamias
The wilcoxon test in coin are meant only for "Testing the equality of the distributions of a numeric response in *two or more* independent groups against shift alternatives" whereas the wilcoxon test in the base pacakge "Performs *one-* and two-sample Wilcoxon tests on vectors of data; the latt

Re: [R] How to show classes with 0 count in table()?

2011-10-31 Thread Bert Gunter
Rob: Probably a on-reply, as it requires the OP to do exatly what he does not want to -- fill in the values manually. Rather: > table(factor(x,lev=1:5)) ## make x a factor 1 2 3 4 5 3 3 0 0 3 -- Bert On Mon, Oct 31, 2011 at 8:48 AM, Rob Griffin wrote: > x<-matrix(c(1,2,3,4,5,3,3,0,0,**3),nr

Re: [R] How to get Quartiles when data contains both numeric variables and factors

2011-10-31 Thread R. Michael Weylandt
Let me caution against this approach as factors are generally stored in R as integers but in a way that's not particularly meaningful for most applications. This will silently make use of those internal codes, the quantiles of which probably are not helpful for what you are looking for. Furthermore

Re: [R] How to show classes with 0 count in table()?

2011-10-31 Thread Rob Griffin
x<-matrix(c(1,2,3,4,5,3,3,0,0,3),nrow=2,ncol=5,byrow=TRUE) x [,1] [,2] [,3] [,4] [,5] [1,]12345 [2,]33003 -Original Message- From: Leonardo Bergamini Sent: Monday, October 31, 2011 1:35 PM To: r-help@r-project.org Subject: [R] How to show

Re: [R] Function input for regression analysis

2011-10-31 Thread R. Michael Weylandt
Have you seen the lm() function? I think it does what you are talking about, but the vagueries of your statement make it hard for me to give a concrete answer. It does worry me to think of you having one function to do all your regressions analysis ever for any problem whatsoever Michael On M

Re: [R] How to get Quartiles when data contains both numeric variables and factors

2011-10-31 Thread andrija djurovic
Or this: > str(x) 'data.frame': 100 obs. of 6 variables: $ x1: num 0.4548 0.0352 0.6353 0.6017 0.8588 ... $ x2: num 0.849 0.335 0.986 0.617 0.212 ... $ x3: num 1.35 0.46 1.67 1.23 1.14 ... $ x4: num 2.67 0.91 3.31 2.48 2.28 ... $ x5: Factor w/ 3 levels "1","2","3": 3 1 3 3 3 1 2 3 3 1 .

Re: [R] How to get Quartiles when data contains both numeric variables and factors

2011-10-31 Thread R. Michael Weylandt
Just add something to skip the non-numeric variables: e.g., lapply(x, function(x) if(is.numeric(x)) quantile(x,c(0.01, 0.99)) else levels(x)) If you want to use sapply(), you'll need the factor case to return something that is 2x1 so it can all be simplified nicely. Michael On Mon, Oct 31, 201

Re: [R] How to show classes with 0 count in table()?

2011-10-31 Thread jim holtman
?tabulate > x<-c(1,1,1,2,2,2,5,5,5) > tabulate(x) [1] 3 3 0 0 3 > On Mon, Oct 31, 2011 at 8:35 AM, Leonardo Bergamini wrote: > I need a table showing even the zero counts. > > x<-c(1,1,1,2,2,2,5,5,5) > table(x) > x > 1 2 5 > 3 3 3 > > > How can I get this: > > x > 1 2 3 4 5 > 3 3 0 0 3 > > Thank

[R] Single line command for variance of marginal distribution in 2 D linear regression?

2011-10-31 Thread Vern
Dear forum, we have a 2 dimensional normal distribution of (x, y) which is consistent with a linear regression modell of type y = ax + b. It has a heteroscedastic variance. Is there a straight and simple way with R to get the variance of the marginal distribution W(y|x=xi) where xi may be rando

Re: [R] How to show classes with 0 count in table()?

2011-10-31 Thread R. Michael Weylandt
It's not a totally general solution but something like table( factor(x, levels = min(x):max(x))) will do it in this case. The key is to make understand that R converts your data to a factor if necessary and then checks each level of that factor. Here we are taking care of the factor conversion ex

[R] Question on estimating standard errors with noisy signals using the quantreg package

2011-10-31 Thread Thorsten Vogel
Dear all, My question might be more of a statistics question than a question on R, although it's on how to apply the 'quantreg' package. Please accept my apologies if you believe I am strongly misusing this list. To be very brief, the problem is that I have data on only a random draw, not all of

Re: [R] assignment operator <- does not work in a function...

2011-10-31 Thread R. Michael Weylandt
It's a matter of environments: your function makes "veri" for purposes of the function but then throws it away when the function is done. If you want it to be accessible you need to assign it to the global environment with something like assign("veri", read.transactions("c:/RVerileri/BitirmeVeri.

[R] one sample Wilcoxon test using 'coin'

2011-10-31 Thread Holger Taschenberger
Hi, R allows me to run a one sample Wilcoxon test like this: wilcox.test(c(1,3.5,2.1,4,1.5,5), mu=2, exact=TRUE) The function 'wilcoxsign_test' from the package 'coin' should (I suppose) be able to calculate exact p values even if there are ties in the ranks. However, I couldn't find information

Re: [R] How to get Quartiles when data contains both numeric variables and factors

2011-10-31 Thread andrija djurovic
Hi, you are almost there: >sapply(x, function(x) quantile(as.numeric(x), c(0.01, 0.99))) x1 x2 x3x4 x5 x6 1% 0.0351777 0.007628441 0.225533 0.4459064 1 1 99% 0.9938919 0.964901423 1.826894 3.6226944 3 2 Andrija On Mon, Oct 31, 2011 at 2:09 PM, aajit75 wrote

Re: [R] How to use IML with R and SAS

2011-10-31 Thread Rick Wicklin
The SAS/IML documentation on calling R is at http://support.sas.com/documentation/cdl/en/imlug/64248/HTML/default/viewer.htm#r_toc.htm Other ways to get help include calling SAS Technical Support (it's free) and posting your question to the SAS/IML Discussion forum at http://communities.sas.com/com

[R] How to show classes with 0 count in table()?

2011-10-31 Thread Leonardo Bergamini
I need a table showing even the zero counts. x<-c(1,1,1,2,2,2,5,5,5) table(x) x 1 2 5 3 3 3 How can I get this: x 1 2 3 4 5 3 3 0 0 3 Thanks, [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mai

[R] assignment operator <- does not work in a function...

2011-10-31 Thread Levent TERLEMEZ
Dear Users, I have a little problem with assignment operator. It's working from command prompt but does not work same as in the command prompt in the function. Am I missing or forgetting something? The function is (tried on both 2.13.1 and 2.13.2) as below using arules and arulseViz packages:

[R] Function input for regression analysis

2011-10-31 Thread flokke
Dear all, I have a small question. I would like to write a function for a regression analysis that an be applied to every dataset. Now my problem is that I do not know what I have to implement then as input for the function mytest <- function (x,y) { beta <- sol

Re: [R] tryCatch with integration

2011-10-31 Thread William Dunlap
You want the error= argument to tryCatch to be the function that computes the intergral by the backup method. The finally= argument is treated as an expression (not a function) that is evaluated (not called) after all the other work in tryCatch has been done. The value of the evaluated finally ex

[R] How to get Quartiles when data contains both numeric variables and factors

2011-10-31 Thread aajit75
When data contains both factor and numeric variables, how to get quartiles for all numeric variables? n <- 100 x1 <- runif(n) x2 <- runif(n) x3 <- x1 + x2 + runif(n)/10 x4 <- x1 + x2 + x3 + runif(n)/10 x5 <- factor(sample(c('a','b','c'),n,replace=TRUE)) x6 <- factor(1*(x5=='a' | x5=='c')) dat

Re: [R] Lm function: Error in model.frame.default

2011-10-31 Thread R. Michael Weylandt
I don't know if you've gotten any follow up, but here are some quick reactions: 1) You make reference to the columns of y but your dput(y) does not provide columns, 2) It's still not clear to me what all this data actually means? Do you have multiple observations of the dependent variable corresp

Re: [R] Can't install rJava

2011-10-31 Thread R. Michael Weylandt
rJava is currently available on both CRAN and RForge and there do not appear to be any issues with R 2.12. Are you sure you had a working internet connection when you tried this? It's sort of a big-ish package and when I've had trouble with it, it turned out my network was being buggy. Michael On

Re: [R] Error in dim(data) <- dim : attempt to set an attribute on NULL.

2011-10-31 Thread R. Michael Weylandt
This isn't reproducible for a few reasons, but notably that you didn't provide data or tell us which vif() function you are using. (There are a few from different packages). Can you clarify which package and see if it can be done with simulated data / post a working sample of your data? It may jus

Re: [R] quantmod package

2011-10-31 Thread R. Michael Weylandt
Dear Ata, I just tested it and it worked just fine for me. Perhaps you need to test it during US market hours rather than when they are closed. (I'm not sure what the yahoo finance website does then). If you want to keep the whole getQuote object, you will probably have to do a little work on the

Re: [R] How to use IML with R and SAS

2011-10-31 Thread alanm (Alan Mitchell)
I will respond off list since the issue is mostly related to SAS. Alan Mitchell, MSc Biostatistician al...@crab.org -Original Message- From: Cheryl Johnson [mailto:johnson.cheryl...@gmail.com] Sent: Sunday, October 30, 2011 5:02 PM To: r-help@r-project.org Subject: [R] How to use IML wit

Re: [R] Contrasts with an interaction. How does one specify the dummy variables for the interaction

2011-10-31 Thread Max Kuhn
This is failing because it is a saturated model and the contrast package tries to do a t-test (instead of a z test). I can add code to do this, but it will take a few days. Max On Fri, Oct 28, 2011 at 2:16 PM, John Sorkin wrote: > Forgive my resending this post. To data I have received only one

Re: [R] help with parallel processing code

2011-10-31 Thread Max Kuhn
I'm not sure what you mean by full code or the iteration. This uses foreach to parallelize the loops over different tuning parameters and resampled data sets. The only way I could set to split up the parallelism is if you are fitting different models to the same data. In that case, you could launc

Re: [R] unset proxy in R

2011-10-31 Thread peter dalgaard
On Oct 31, 2011, at 13:25 , carol white wrote: > Hello, > > Is Sys.unsetenv the right function to unset the proxy in R? > > Possibly, but changing the subject of an earlier thread is not the right way to pose a question on R-help... (Send a new message. Replying to an old one causes the new

Re: [R] How to use IML with R and SAS

2011-10-31 Thread Frank Harrell
Following on Josh's note, it would be interesting to know what tasks the OP is doing in SAS that would be hard to do in R. Frank Joshua Wiley-2 wrote: > > Hi Cheryl, > > Since your question is how to analyze the data and the data is being > analyzed in SAS, my guess is that you will have to go t

[R] unset proxy in R

2011-10-31 Thread carol white
Hello, Is Sys.unsetenv the right function to unset the proxy in R? Cheers, Carol __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provi

Re: [R] Rpart

2011-10-31 Thread mxkuhn
This mostly happens when the data contain invalid column names (such as all numbers). Try using make.names() on the datasets. Max On Oct 30, 2011, at 11:35 AM, Luisa Sêco wrote: > Dear users, > > I'm using rpart for classification trees, but my code isn't working when I > try to use all the

Re: [R] calculating joint entropy of many variables

2011-10-31 Thread Mehmet Suzen
You may want to use this for basic measures : http://cran.r-project.org/web/packages/entropy/ from http://strimmerlab.org/software/entropy/ Look at their paper, it may give you some idea Before going into more complicated cases, http://arxiv.org/PS_cache/arxiv/pdf/0811/0811.3579v3.pdf >

Re: [R] 3 Overlayed simple plots

2011-10-31 Thread Barry Rowlingson
On Mon, Oct 31, 2011 at 8:54 AM, Rolf Turner wrote: > On 31/10/11 21:13, Alaios wrote: >> >> Dear all, >> I am plotting 3 plots into the same x and y axis. >> I want the first one to be painted red with a continuous line >> The second one green with a continuous line >> and the third one blue with

Re: [R] query for xlim/ylim of current plot

2011-10-31 Thread Eik Vettorazzi
Hi Lukas, does par("usr") help? Cheers. Am 31.10.2011 11:34, schrieb eldor ado: > der R-listers, > > does anyone of you know whether there is a function which returns the > xlim/ylim ranges of the current plot (i would like to use coordinates > to place some text via a function, regardless of th

[R] query for xlim/ylim of current plot

2011-10-31 Thread eldor ado
der R-listers, does anyone of you know whether there is a function which returns the xlim/ylim ranges of the current plot (i would like to use coordinates to place some text via a function, regardless of the x/y lims of the plot). best regards, lukas kohl

[R] R 2.14.0 is released

2011-10-31 Thread Peter Dalgaard
The byte pixies have rolled up R-2.14.0.tar.gz (codename "Great Pumpkin") at 9:00 this morning. This is a development release with several new features; see the list below for details. You can get it from http://cran.r-project.org/src/base/R-2/R-2.14.0.tar.gz or wait for it to be mirrored at a

Re: [R] rle for non concecutive

2011-10-31 Thread Paul Hiemstra
On 10/31/2011 09:34 AM, Joshua Wiley wrote: > On Mon, Oct 31, 2011 at 2:29 AM, Alaios wrote: >> Dear all, >> I would like to task you if you know a rle version that can work also in a >> non consecutive way too. The whole idea of rle is to have consecutive runs. Please specify more clearly what

Re: [R] rle for non concecutive

2011-10-31 Thread Joshua Wiley
On Mon, Oct 31, 2011 at 2:29 AM, Alaios wrote: > Dear all, > I would like to task you if you know a rle version that can work also in a > non consecutive way too. You mean just a counter for an objects occurence? like: A B A A B B C would give 1 1 2 3 2 3 1? I am not clear what non consecutive

[R] rle for non concecutive

2011-10-31 Thread Alaios
Dear all, I would like to task you if you know a rle version that can work also in a non consecutive way too. B.R Alex [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

Re: [R] Get missinfg values with dataframe using read.spss

2011-10-31 Thread Smart Guy
Hi Joshua, Thanks for the help. use.missings=TRUE is not helpful. But yes, I think gettting it as a list and data frame is good idea. I will try that. I am sure it will work. Is there any other way, so that I dont have to keep two copies of same data? Thanks again. Regards, SG On 31 O

Re: [R] 3 Overlayed simple plots

2011-10-31 Thread Paul Hiemstra
On 10/31/2011 08:13 AM, Alaios wrote: > Dear all, > I am plotting 3 plots into the same x and y axis. > I want the first one to be painted red with a continuous line > The second one green with a continuous line > and the third one blue with a continuous line > > plot(max_power(data),ylim=c(-120,-2

Re: [R] 3 Overlayed simple plots

2011-10-31 Thread Rolf Turner
On 31/10/11 21:13, Alaios wrote: Dear all, I am plotting 3 plots into the same x and y axis. I want the first one to be painted red with a continuous line The second one green with a continuous line and the third one blue with a continuous line plot(max_power(data),ylim=c(-120,-20)) par(new

[R] 3 Overlayed simple plots

2011-10-31 Thread Alaios
Dear all, I am plotting 3 plots into the same x and y axis. I want the first one to be painted red with a continuous line The second one green with a continuous line and the third one blue with a continuous line plot(max_power(data),ylim=c(-120,-20))     par(new=T)     plot(min_power(data),ylim=c(

  1   2   >