[R] nls: singular convergeance

2011-10-12 Thread Redding, Matthew
Dear R-experts, I have 28 data points that I would like to fit with a non linear broken-stick -- with three fitted parameters. When I view trace -- and use the final values as lines on the graph of data -- it looks pretty good. Q1. Why am I getting singular convergeance? Q2. Can you suggest anot

[R] using dynamic variable names

2011-10-12 Thread Sasso Kocovski
Hi, hopefully you can help me out - thanks in advance. I would like to assign variable (or vectors) names dynamically, hence, after you assign the number of new vectors then they populate for use later in the algorithm. Below is an example: n<-5 for (i in (1:n)) { vector_i <- c(1:10) } Here wha

[R] Simple Effects Analysis for ANOVA

2011-10-12 Thread robcinm
For an ANOVA class assignment, we are doing post-hoc tests for interactions. For simple effect analysis on an interaction, I went through a really convoluted process to get my statistics and want to know if there is a more straightforward way. I have a 3x2 design with self-concept 1:3 (low, moder

[R] KS test

2011-10-12 Thread anuradha guru
Hi! how can I do the Kolmogorov Smirnov test for discrepancy between the estimated and empirical tails? Regards Anuradha [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLE

Re: [R] Help with R plots

2011-10-12 Thread Jeff Newmiller
All complete newbies should read the posting guide referenced at the bottom of every message. One of the rules mentioned there is that this is not the appropriate venue for homework questions, since you have an instructor to get you up to speed. When you finish the course and are familiar with t

Re: [R] Comparing the components of a data frame without levels interfering

2011-10-12 Thread Jeff Newmiller
Factors include a comprehensive list of all possible values they can assume. Your name columns have different numbers of names, so they are really very different factors. The best solution for you is to convert those columns to character. You also ought to learn how to use the merge function be

Re: [R] Comparing the components of a data frame without levels interfering

2011-10-12 Thread Petr PIKAL
Hi > *Bottom Line: How can I compare the individual components of two data frames > with different row lengths without the levels interfering?* > > Example: I have two data frames to those respectively named 'dfCity' and > 'dfState' that have the following output: > > dfCity > > Name

[R] Package snow: is there any way to check if a cluster is "acticve"

2011-10-12 Thread Søren Højsgaard
Is there a 'proper' way of checking if cluster is active. For example, I create a cluster called .PBcluster > str(.PBcluster) List of 4 $ :List of 3 ..$ con :Classes 'sockconn', 'connection' atomic [1:1] 3 .. .. ..- attr(*, "conn_id")= ..$ host: chr "localhost" ..$ rank: int 1 ..- at

Re: [R] pass an element in a list() from R to C

2011-10-12 Thread teazrq
so, I did this: B= list("a" = 1, "b" = 2, "c" = 3) .C("myfunction", B) the c code is : SEXP myfunction(SEXP matrix_temp) { Rprintf("this element is %6.3f", REAL(VECTOR_ELT(matrix_temp,1))[0]); } but after runing the R code, it says Error: VECTOR_ELT() can only be applied to a 'list', not

Re: [R] plot probability density function (pdf)

2011-10-12 Thread pigpigmeow
thank you all of u -- View this message in context: http://r.789695.n4.nabble.com/plot-probability-density-function-pdf-tp3897055p3900396.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.et

[R] Comparing the components of a data frame without levels interfering

2011-10-12 Thread swonder03
*Bottom Line: How can I compare the individual components of two data frames with different row lengths without the levels interfering?* Example: I have two data frames to those respectively named 'dfCity' and 'dfState' that have the following output: dfCity Name City 1Bill

Re: [R] How to transfer the variable into function in this code?

2011-10-12 Thread R. Michael Weylandt
As provided, the function you give doesn't actually do anything, it only defines some subfunctions which are removed upon completion of the function call. If that were the actual function, you would be right to be confused, but the provided code doesn't give the proper context to the problem. You

Re: [R] R and Forex

2011-10-12 Thread Joshua Ulrich
Yves and Michael, R-devel is the place for programming questions that would be confusing to most people who follow R-help. Posting to R-devel would make sense if you've written socket connections between applications in other languages and are having trouble sorting out how to do it in R. If you

Re: [R] R and Forex

2011-10-12 Thread R. Michael Weylandt
To be honest, I don't frequently have occasion to wander over to R-devel and most of what goes on over there is over my level of easy-readability but I'd feel pretty confident that anything involving interface to another program on a socket or lower level is squarely their territory while file-r

Re: [R] Help with R plots

2011-10-12 Thread Weidong Gu
try hist(gender$HeartRate,main='Histogram: HeartRate distribution for Temperature Data') Weidong Gu On Wed, Oct 12, 2011 at 8:44 PM, Jonathan Edwin wrote: > Hi all, > > Mind my ignorance and complete newbiness, but I am very new to R and am > currently learning it through my stats course at un

Re: [R] R and Forex

2011-10-12 Thread Yves S. Garret
I'm a little vague on what constitutes r-help and r-devel lists in terms of what questions to ask and where. I read a little bit that this list was about design and what you could do in R, but coding should be in r-devel. If I'm wrong, please clarify. On Wed, Oct 12, 2011 at 9:12 PM, R. Michael

[R] Help with R plots

2011-10-12 Thread Jonathan Edwin
Hi all, Mind my ignorance and complete newbiness, but I am very new to R and am currently learning it through my stats course at university. My question is regarding adding titles to plots. I'll post the code below, and then explain my issue: > hist(gender$HeartRate) > title(Histogram: HeartRate

[R] US States percentage change plot

2011-10-12 Thread Michael Charles Bailey I
Hi, I would like to make a plot of the US states (or lower 48) that are colored based upon a percentage change column. Ideally, it would gradually be more blue the larger the positive change, and more red the more negative is the change. The data I have looks like: State Percent.Change 1

[R] pass an element in a list() from R to C

2011-10-12 Thread teazrq
Hi all, I'm new to this "call C from R" so bear with me. I'v been writing some C code and compile it to .dll files that can be called from R. It was successful until today, when I start a new part of this project. So, my R code passes arguments to this C code, and these arguments including some in

Re: [R] R and Forex

2011-10-12 Thread Yves S. Garret
Don't see myself making 'real-time' trades. Most likely a few times an hour. Oh, can't you make a socket to another app in R? That would be my first approach. On Wed, Oct 12, 2011 at 6:53 PM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > Just a comment on the lack of a direct R AP

Re: [R] R and Forex

2011-10-12 Thread R. Michael Weylandt
I suppose you could, contingent on the broker end's functionality, and R does provide some socket support (see ?make.socket and ?connections among others) but I suspect your question is entering the domain of the R-devel list where the experts on the nitty gritty could give you better answers th

Re: [R] getting data associated with coordinates in a spatial data frame

2011-10-12 Thread Sarah Goslee
Hi, On Wed, Oct 12, 2011 at 3:37 PM, Bailey, Daniel wrote: > If I know the specific coordinate in a spatial data frame, how can I access > the data at that coordinate? > > My coordinates are labeled "x" and "y" in a data.frame "e". The data is in > column "leachate". > I want to say, basically:

Re: [R] using csv file for stacked bar plot, rows to columns

2011-10-12 Thread Sarah Goslee
Hi, On Wed, Oct 12, 2011 at 6:11 PM, Davis_fishgirl wrote: > > **NEW TO R**-been trying to teach myself with no prior experience in > computer languages, so I apologize if I am poor at using technical terms > Hi, I have perused some of the previous posts on this topic and tried their > solutions,

Re: [R] strange behavior with R.dll

2011-10-12 Thread Joshua Wiley
On Oct 12, 2011, at 17:23, Duncan Murdoch wrote: > On 11-10-12 7:54 PM, Joshua Wiley wrote: >> I regularly have the R.dll removed. AFAI can tell, it depends partly on how >> aggressive a heuristic level you have chosen, in part I think related to the >> number of users. In any case you can re

Re: [R] strange behavior with R.dll

2011-10-12 Thread Duncan Murdoch
On 11-10-12 7:54 PM, Joshua Wiley wrote: I regularly have the R.dll removed. AFAI can tell, it depends partly on how aggressive a heuristic level you have chosen, in part I think related to the number of users. In any case you can restore it and set a rule to have it ignored. I suppose you

Re: [R] strange behavior with R.dll

2011-10-12 Thread Joshua Wiley
I regularly have the R.dll removed. AFAI can tell, it depends partly on how aggressive a heuristic level you have chosen, in part I think related to the number of users. In any case you can restore it and set a rule to have it ignored. I suppose you could tell symantec, but it's never been en

[R] using csv file for stacked bar plot, rows to columns

2011-10-12 Thread Davis_fishgirl
**NEW TO R**-been trying to teach myself with no prior experience in computer languages, so I apologize if I am poor at using technical terms Hi, I have perused some of the previous posts on this topic and tried their solutions, but am still coming up with error messages(sometimes more than 50 at

[R] How to transfer the variable into function in this code?

2011-10-12 Thread xingxing
as shown in the code, four variables input: diff_expr,diff_coex, klist, Pop_size, are included in the function. However, within the function, another variable "vector" is utilized in some subfunction. How they get its value? thx get_quantiles <-function(diff_expr,diff_coex,klist,pop_size){ #

[R] getting data associated with coordinates in a spatial data frame

2011-10-12 Thread Bailey, Daniel
If I know the specific coordinate in a spatial data frame, how can I access the data at that coordinate? My coordinates are labeled "x" and "y" in a data.frame "e". The data is in column "leachate". I want to say, basically: e$leachate@coordinates(2,3). Thanks

Re: [R] how to calculate the statistics of a yearly window with a rolling step as 1 day?

2011-10-12 Thread Gabor Grothendieck
On Wed, Oct 12, 2011 at 9:12 AM, ecoc wrote: > This doesn't work becaues the rollappy is non-overlapping. My rolling step is > 1-day and rolling window is 1-year, so there is 364 days overlapping. > Its not the case that rollapply is non-overlapping. rollapply by default calls the function on a

Re: [R] R and Forex

2011-10-12 Thread R. Michael Weylandt
Just a comment on the lack of a direct R API for non-IBrokers brokerages: of course its possible to put something together using rJava or a direct C interface, but it's not the smoothest thing if you've never delved into the R internals and it's not quite the fastest thing in the world if you are d

[R] dcc in 'bootRes' package

2011-10-12 Thread Xanthe Walker
Hello, I am trying to complete a response function analysis using the command dcc in the package 'bootRes'. Here is my code: DC<-read.table("Dalton.txt", header=T) climate<-read.table("climate.txt", header=T) dcc.DC<-dcc(DC, climate, method ="response", start = -4, end =9) My data is formatted c

Re: [R] R and Forex

2011-10-12 Thread David Winsemius
On Oct 12, 2011, at 10:40 AM, Yves S. Garret wrote: When can I send stuff to the mailing list without having moderator approval? Is that possible? If you register (and you are currently registered at that address ) you can generally avoid moderation. The view available to the moderators

Re: [R] Applying function to only numeric variable (plyr package?)

2011-10-12 Thread Dennis Murphy
Hi: One approach to this problem in plyr is to use the recently developed mutate() function rather than ddply(). mutate() is a somewhat faster version of transform(); when used as a standalone function, it doesn't take a grouping variable as an argument. For this example, one could use mutate(df,

Re: [R] large numbers

2011-10-12 Thread David Winsemius
On Oct 12, 2011, at 3:16 PM, Veerappa Chetty wrote: Hi, When I import an excel "CSV" file, large numbers such as " 43988014.3" is imported as "43988014", leaving out the decimal ".4". How to import keeping the fraction? "Import from Excel" is a vague problem statement. It's also kind of

Re: [R] Chi-Square test and survey results

2011-10-12 Thread Greg Snow
The chisq.test function is expecting a contingency table, basically one column should have the count of respondents and the other column should have the count of non-respondents (yours looks like it is the total instead of the non-respondents), so your data is wrong to begin with. A significant

Re: [R] monotonic factors

2011-10-12 Thread Greg Snow
One approach would be to code dummy variables for your factor levels, have d1 equal to 0 for 'low' and 1 for 'med' and 'high', then have d2 equal to 1 for 'high' and 0 otherwise. For linear regression there are functions that will fit a model with all non-negative coefficients, but I don't know

[R] Mysterious Eclipse / StatET error messages

2011-10-12 Thread Al Roark
All, I'm not sure when this started, but I've noticed that just about any time I add to an R script in Eclipse, I get a warning in Eclipse's error log that looks like the following: Unhandled/Unknown code of R AST node: Code: 0x100 Node: <- (195, 70) Line 4 at offset 195 (can be wro

Re: [R] reasonable theory?

2011-10-12 Thread Spencer Graves
If you know nothing about the black box except that its domain is bounded, then I would random sample uniformly from the domain. If the function is monotonically increasing in all variables, then you only need to test the two extreme points. If you know other things, you may be able to use th

Re: [R] Problem with pmax and matrix to calculate row maxima

2011-10-12 Thread R. Michael Weylandt
I think Enrico's solution is probably better overall and doesn't require as much ugly behind-the-scenes trickery, but here's another fun way that seems to run ever-so-marginally faster on my machine. The vapply call is messy, but it seems to get the job done -- if it's not clear, the point is to b

Re: [R] treat NA's as zero when summed up with numbers

2011-10-12 Thread Bert Gunter
How about, more simply: > mysum <- function(x)sum(x,na.rm = any(!is.na(x))) > mysum(c(1,NA)) [1] 1 > mysum(c(NA,NA)) [1] NA -- Bert On Wed, Oct 12, 2011 at 11:03 AM, David Winsemius wrote: > > On Oct 12, 2011, at 1:33 PM, David Winsemius wrote: > > >> On Oct 12, 2011, at 12:45 PM, Samir Benzerf

[R] reasonable theory?

2011-10-12 Thread James Cloos
Before coding this in C, I wanted to test the idea out in R. But I'm unsure if the theory is well-founded. I have a (user-supplied) black-box function which takes R^n -> R^3 and a defined domain for each of the input reals. I want to send some samples through the box to determine an approximatio

Re: [R] Generelized Negative Binomial model in R

2011-10-12 Thread Ben Bolker
Steve Lianoglou gmail.com> writes: > > Hi, > > On Wed, Oct 12, 2011 at 11:23 AM, Akram Khaleghei Ghosheh balagh > gmail.com> wrote: > > Hello; > > > > Does anybody knows that R have a function for Generelized Negative Binomial > > model, something like "gnbreg" in "STATA" where dispersion para

Re: [R] loop function within a loop

2011-10-12 Thread William Dunlap
Is this the result you are after, where the event number (within a group) are sorted according to the event/prev_event pairs (prev_event in a row matches event of the previous row)? > ave(d, d$group, FUN=function(z) z[ match(tsort(z$prev_event, z$event)[-1], > z$event), ]) event prev_event gr

Re: [R] reading large numbers

2011-10-12 Thread R. Michael Weylandt
Like I said on the other thread you started on this same issue, this is just a print setting, not something with the data. Consider this: R> as.numeric(4398801.3) == 4398801.3 TRUE If you want to change this, try options(digits = 14) # or however many you want to see And don't jump ship on t

Re: [R] reading large numbers

2011-10-12 Thread Sarah Goslee
I believe you were already answered. Nothing is happening to your numbers. The default digits used to *display* your numbers is too small to show all the decimal places. There's nothing to worry about; full precision is being used for all calculations. But if for some reason you'd like to see th

Re: [R] large numbers

2011-10-12 Thread R. Michael Weylandt
Well that's different. Can you restart R and get the same error message? If so, change print() to print.default() to get around the class error for now. And I just want to make sure of one thing: you did actually change "valueFromImport" to whatever you named the output of the read.csv() call, rig

[R] reading large numbers

2011-10-12 Thread Veerappa Chetty
Hi, This happens when I read in large numbers; > as.numeric(4398801.3) [1] 4398801 > as.numeric(439880.3) [1] 439880.3 Please help to read in numbers with more than 8 characters! Thanks. Chetty -- Professor of Family Medic

Re: [R] large numbers

2011-10-12 Thread R. Michael Weylandt
Are you sure its being imported into R without the decimal and that it's not just a print option? I can't off the cuff think of a reason why that would happen... Try print(valueFromImport - 43988014) and see what you get Michael On Wed, Oct 12, 2011 at 3:16 PM, Veerappa Chetty wrote: > Hi, > Wh

[R] large numbers

2011-10-12 Thread Veerappa Chetty
Hi, When I import an excel "CSV" file, large numbers such as " 43988014.3" is imported as "43988014", leaving out the decimal ".4". How to import keeping the fraction? Thanks. Chetty -- Professor of Family Medicine Boston University Tel: 617-414-6221, Fax:617-414-3345 emails: chett...@gmail.com,v

Re: [R] Simple question regarding to specifying model

2011-10-12 Thread BvZ
Tried this, it does not seem to work. It is really simple what I am trying to do. I have a pre-specified best-fit line, and wish to run some diagnostic tests for goodness of fit. I will play around with the predict function, thanks a lot David! -- View this message in context: http://r.78969

Re: [R] strange behavior with R.dll

2011-10-12 Thread Duncan Murdoch
On 12/10/2011 3:03 PM, Erin Hodgess wrote: Dear R People: I am using R-2.13.2 on a Windows 7 machine. I compiled from source on 32 bit a couple of weeks ago and the R.dll got removed by my anti-virus software. Same thing on 64 bit today. Is anyone having this problem, please? I'm using Norto

Re: [R] R and Forex

2011-10-12 Thread R. Michael Weylandt
As was pointed out to you before, this is really more of an R-SIG-Finance question, but I wouldn't expect too much explanation there either, just people pointing you to the standard R finance tools (quantmod, zoo/xts, TTR, RBloomberg, and the Rmetrics suite; there's also some fantastic tools in dev

Re: [R] Tinn-R change editor background color

2011-10-12 Thread Ben qant
Never mind: option > color preference Sorry...overlooked that 10 times I guess. regards On Wed, Oct 12, 2011 at 12:54 PM, Ben qant wrote: > Hello, > > Does anyone know how to change the Tinn-R editor background color? White is > rough on the eyes... > > Thanks, > Ben > [[alternative H

[R] strange behavior with R.dll

2011-10-12 Thread Erin Hodgess
Dear R People: I am using R-2.13.2 on a Windows 7 machine. I compiled from source on 32 bit a couple of weeks ago and the R.dll got removed by my anti-virus software. Same thing on 64 bit today. Is anyone having this problem, please? I'm using Norton AV. Thanks, Erin -- Erin Hodgess Associ

[R] Tinn-R change editor background color

2011-10-12 Thread Ben qant
Hello, Does anyone know how to change the Tinn-R editor background color? White is rough on the eyes... Thanks, Ben [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

Re: [R] Simple question regarding to specifying model

2011-10-12 Thread David Winsemius
On Oct 12, 2011, at 2:25 PM, BvZ wrote: I have hunted around but cannot find the command which allows me to specify parameters of a model. For example, model.m1 <- nls(y ~ alpha * x1/(beta + x1), data = data, start = list(beta = 20, alpha = 120), trace = TRUE) This will estimate the par

Re: [R] How to run Rcmdr with OS 10.4?

2011-10-12 Thread Robert Baer
As the posting guide tells you, the first thing to try is to install the latest version of R. -Original Message- From: roche...@free.fr Sent: Tuesday, October 11, 2011 5:44 AM To: r-help@r-project.org Subject: [R] How to run Rcmdr with OS 10.4? I've installed Rcmdr package and it do

[R] Simple question regarding to specifying model

2011-10-12 Thread BvZ
I have hunted around but cannot find the command which allows me to specify parameters of a model. For example, model.m1 <- nls(y ~ alpha * x1/(beta + x1), data = data, start = list(beta = 20, alpha = 120), trace = TRUE) This will estimate the parameters, which allows to investigate the residual

Re: [R] Minimum cutsets

2011-10-12 Thread malhomidi
Hi Gabor, Thanks for the reply. I'm actually working on directed graphs and using Windows. Please, send me the windows version of the source code. Regards, Mohammed -- View this message in context: http://r.789695.n4.nabble.com/Minimum-cutsets-tp885346p3899012.html Sent from the R hel

[R] Minimization/Optimization under functional constraints

2011-10-12 Thread forget_f1
Hi, I hope someone can help me with the following issue. I need find the minimum beta that satisfies the following: inf{beta>0 | f(x+beta*f(x))*f(x)<=0} where f() is a function and x is a sample statistic. Functions such as "nlminb" and "constrOptim" minimize a function and output the paramete

Re: [R] treat NA's as zero when summed up with numbers

2011-10-12 Thread David Winsemius
On Oct 12, 2011, at 1:33 PM, David Winsemius wrote: On Oct 12, 2011, at 12:45 PM, Samir Benzerfa wrote: Hello everybody, is there any way to treat NA's as zero when they are summed up with numbers, but to treat them as NA's when summed up only with NA's. Specifically want that: 5+NA=

Re: [R] loop function within a loop

2011-10-12 Thread David Winsemius
On Oct 12, 2011, at 10:55 AM, Sally Zhen wrote: Hi all, I'm working on a loop function for a large dataset which contains 1000 different groups. I would like to reconstruct the order of events within each group by using a loop function in R. Not generally a good first strategy in R. (Cu

Re: [R] high and lowest with names

2011-10-12 Thread Ben qant
Hello, This is my solution. This is pretty fast (tested with a larger data set)! If you have a more elegant way to do it (of similar speed), please reply. Thanks for the help! ## get highest and lowest values and names of a matrix # create sample data x <- swiss$Education[1:25] da

Re: [R] treat NA's as zero when summed up with numbers

2011-10-12 Thread David Winsemius
On Oct 12, 2011, at 12:45 PM, Samir Benzerfa wrote: Hello everybody, is there any way to treat NA's as zero when they are summed up with numbers, but to treat them as NA's when summed up only with NA's. Specifically want that: 5+NA=5, but NA+NA=NA (and not zero). sum(x , na.rm=TRUE)

Re: [R] exclude columns with at least three consecutive zeros

2011-10-12 Thread William Dunlap
First define a function that returns TRUE if a column should be dropped. E.g., has3Zeros.1 <- function(x) { x <- x[!is.na(x)] == 0 # drop NA's, convert 0's to TRUE, others to FALSE if (length(x) < 3) { FALSE # you may want to further test short vectors } else {

Re: [R] loop function within a loop

2011-10-12 Thread Weidong Gu
It's better to avoid loop in this situation. If you want to reorder subsets of the data based on event, the follow works df<-read.table('clipboard',header=TRUE) sp.or<-lapply(split(df,df$group),function(ldf) ldf[order(ldf$event),]) new.df<-do.call('rbind',sp.or) Weidong Gu On Wed, Oct 12, 2011 a

Re: [R] Minimum cutsets

2011-10-12 Thread Gábor Csárdi
Hi Mohammed, http://igraph.sourceforge.net/doc/R/graph.maxflow.html For directed graphs, and s-t cuts you need the development version, from igraph.sf.net. The source code is either here: http://cran.r-project.org/web/packages/igraph/index.html or here: http://code.google.com/p/igraph/downloads/l

Re: [R] Nonlinear regression aborting due to error

2011-10-12 Thread Jean V Adams
Dennis Fisher wrote on 10/12/2011 08:06:12 AM: > > jean > > initial values: > INITEMAX <- -25 > INITEFFECT <- 25 > INITC50 <- 14 > GAMMA <- INITGAMMA <- 500 > > see below for other issues. > > dennis > > Dennis Fisher MD > P < (The "P Less

Re: [R] Generelized Negative Binomial model in R

2011-10-12 Thread Steve Lianoglou
Hi, On Wed, Oct 12, 2011 at 11:23 AM, Akram Khaleghei Ghosheh balagh wrote: > Hello; > > Does anybody knows that R have a function for Generelized Negative Binomial > model, something like "gnbreg" in "STATA" where dispersion parameter itself > is a function of covaraites ? Take a look at the ed

Re: [R] CVbinary - Help

2011-10-12 Thread Weidong Gu
Maybe it was caused by your modeling binary variable using lm rather than glm. Weidong Gu On Wed, Oct 12, 2011 at 9:59 AM, anamiguita wrote: > Hey, > > I need some help. > > I want to obtain a cross validation for a regression model (binary response) > but I got an error with CVbinary. Well I di

[R] SARIMAX as extended AR(I)MAX?

2011-10-12 Thread testrider
I am currently trying to make a forecast based on past observations of the dependent variable AND external variables at the same time. I know that ARIMAX allows you to do this, however when I use this function it fits the model using the last k lags. What i actually want is to decide on the best mo

Re: [R] plot probability density function (pdf)

2011-10-12 Thread Bert Gunter
Please -- this is not your personal help advisor. Use R's Help facilities before posting. -- Bert On Wed, Oct 12, 2011 at 8:20 AM, pigpigmeow wrote: > x11() > what does it mean? > ?x11 > > if my data has missing value, can I plot the graph? > Try it and see. > > -- > View this message in c

[R] treat NA's as zero when summed up with numbers

2011-10-12 Thread Samir Benzerfa
Hello everybody, is there any way to treat NA's as zero when they are summed up with numbers, but to treat them as NA's when summed up only with NA's. Specifically want that: 5+NA=5, but NA+NA=NA (and not zero). Any ideas? Best, S.B. [[alternative HTML version deleted]] _

[R] ARMA and prediction

2011-10-12 Thread Ritz
Hello, I am running an ARMA model to run forecast for changes in S&P 500 prices. My ARMA calculations look as follows armacal <- arma( spdata, order = c(0,4), lag = list(ma = c(1,2,4)) ) Output: Call: arma(x = spdata, order = c(0, 4), lag = list(ma = c(1, 2, 4)) ) Coefficient(s): ma1

Re: [R] R and Forex

2011-10-12 Thread R. Michael Weylandt
"This" being what exactly? Traded in FX using R? Yes, its done everyday, even as I type Michael On Wed, Oct 12, 2011 at 8:10 AM, Yves S. Garret wrote: > No, that's not what I meant.  I was curious if anyone has ever done this > before and how well it worked.  Any tips for a novice? > > On W

[R] Read in cluster files (cdt, atr, gtr)

2011-10-12 Thread Mark Ebbert
Does anyone know if there is a method available to read in cluster files (cdt, atr and gtr)? I found one method (http://bioinformatics.holstegelab.nl/manuals/R/library/integromicsMethods/html/iMethods.read.tv.html), but it doesn't seem to create an object that can be used by "heatmap." The reas

[R] exclude columns with at least three consecutive zeros

2011-10-12 Thread Samir Benzerfa
Hi everyone, I have a large data set with about 3'000 columns and I would like to exclude all columns which include three or more consecutive zeros (see below example). A further issue is that it should just jump NA values if any. How can I do this? In the below example R should exclude col

Re: [R] plot probability density function (pdf)

2011-10-12 Thread pigpigmeow
x11() what does it mean? if my data has missing value, can I plot the graph? -- View this message in context: http://r.789695.n4.nabble.com/plot-probability-density-function-pdf-tp3897055p3898362.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Minimum cutsets

2011-10-12 Thread malhomidi
Hi Gabor, I'm looking for minimum cutsets in the igraph manual but I didn't find the functions you mentioned above. Also, how can I see their source code. Thanks, Mohammed -- View this message in context: http://r.789695.n4.nabble.com/Minimum-cutsets-tp885346p3898347.html Sent from the

Re: [R] Error in Rcpp/inline (Windows XP)

2011-10-12 Thread Prof Brian Ripley
Did you read the posting guide (it says R-help is not for questions about compiled code)? Or the rw-FAQ (it warned you that lots of contributed packages did not take account of spaces in path names, so suggested you install R in a path without one)? This is a bug in one of the packages you a

Re: [R] plot probability density function (pdf)

2011-10-12 Thread jdospina
x11() plot(density(a)) lines(density(d)) x11() plot(density(b)) lines(density(e)) 2011/10/12 pigpigmeow [via R] : > however, if i have an excel file, but there have 6 variables, a,b,c,d,e,f. > > > how to plot the probability density function of a and d in one graph, b and > e in another graph? > >

[R] loop function within a loop

2011-10-12 Thread Sally Zhen
Hi all, I'm working on a loop function for a large dataset which contains 1000 different groups. I would like to reconstruct the order of events within each group by using a loop function in R. (Currently the order of events are based on the ascending order of prev_event within the group) A demo

Re: [R] plot probability density function (pdf)

2011-10-12 Thread R. Michael Weylandt
Assuming you mean you want them on the same device: layout(1:2) plot(density(a)) lines(density(d),col=2) plot(density(b)) lines(density(e),col=2) Getting your data into R is more of a challenge, but if you want my unsolicited advice, you can do far worse than saving as CSV and using read.csv() M

Re: [R] plot probability density function (pdf)

2011-10-12 Thread pigpigmeow
i want to plot probability density function,predictvalue has missing value and observevalue has not missing value, I tried .. attach(test) #test is the name of the data file names(test) plot(density(predictvalue,na.rm=TRUE)) lines(density(observevalue)) is it correct? -- View this message in c

[R] CVbinary - Help

2011-10-12 Thread anamiguita
Hey, I need some help. I want to obtain a cross validation for a regression model (binary response) but I got an error with CVbinary. Well I did this: fit <- lm(resp ~ PC1 + PC2 + PC3 + PC4 + PC5 + PC6 + PC7 + PC8 + PC9+PC10+PC11+PC12+PC13+PC14+PC15+PC16+PC17+PC18+PC19+PC20+PC21+PC22+PC23+PC24

Re: [R] R loop within a loop

2011-10-12 Thread saliluna
I've also tried to make the function work for one particular group, then apply the same function to the whole data frame with all groups using by() or lapply() as follow. But I'm still receiving error messages. Could someone please explain what is happening here? dfdfdf <- function(localdata){ ord

Re: [R] labels in a boxplot

2011-10-12 Thread Andrés Aragón
Francesco, Try cex.axis=0.6 Regards, Andrés AM 2011/10/12, Francesco Sarracino : > Dear R-listers, > > I have a little problem with a boxplot and I hope you can help me figuring > it out. > I'll try to make up some data to illustrate the issue. Sorry, if my > procedures look naive, but these ar

Re: [R] R and Forex

2011-10-12 Thread Yves S. Garret
When can I send stuff to the mailing list without having moderator approval? Is that possible? On Wed, Oct 12, 2011 at 12:19 AM, Liviu Andronic wrote: > On Wed, Oct 12, 2011 at 3:29 AM, Yves S. Garret > wrote: > > Hi all, > > > > I recently started learning about Forex and found this O'Reilly

Re: [R] Problem executing function

2011-10-12 Thread Divyam
Thanks a lot Duncan! It works fine now. Divya -- View this message in context: http://r.789695.n4.nabble.com/Problem-executing-function-tp3894359p3898054.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing lis

[R] Error in Rcpp/inline (Windows XP)

2011-10-12 Thread allenhahaha
Hi, everyone, I am just trying to use Rcpp in my computer, and I would like to try a simple example from website, but R keeps reporting me error. I am using Windows XP, and has installed Rtools and GSI. Here is the response: > src = ' + Rcpp::NumericVector xa(a); + Rcpp::NumericVector xb(b); +

[R] R loop within a loop

2011-10-12 Thread saliluna
Hi, I'm working on a loop function for a large dataset which contains 1000 different groups. I would like to reconstruct the order of events within each group by using a loop function in R. (Currently the order of events are based on the ascending order of prev_event within the group) A demo dat

Re: [R] R and Forex

2011-10-12 Thread Yves S. Garret
No, that's not what I meant. I was curious if anyone has ever done this before and how well it worked. Any tips for a novice? On Wed, Oct 12, 2011 at 12:19 AM, Liviu Andronic wrote: > On Wed, Oct 12, 2011 at 3:29 AM, Yves S. Garret > wrote: > > Hi all, > > > > I recently started learning abo

Re: [R] how to calculate the statistics of a yearly window with a rolling step as 1 day?

2011-10-12 Thread ecoc
This doesn't work becaues the rollappy is non-overlapping. My rolling step is 1-day and rolling window is 1-year, so there is 364 days overlapping. -- View this message in context: http://r.789695.n4.nabble.com/how-to-calculate-the-statistics-of-a-yearly-window-with-a-rolling-step-as-1-day-tp3891

[R] Generelized Negative Binomial model in R

2011-10-12 Thread Akram Khaleghei Ghosheh balagh
Hello; Does anybody knows that R have a function for Generelized Negative Binomial model, something like "gnbreg" in "STATA" where dispersion parameter itself is a function of covaraites ? Thanks; [[alternative HTML version deleted]] __ R-help

Re: [R] plot probability density function (pdf)

2011-10-12 Thread pigpigmeow
however, if i have an excel file, but there have 6 variables, a,b,c,d,e,f. how to plot the probability density function of a and d in one graph, b and e in another graph? -- View this message in context: http://r.789695.n4.nabble.com/plot-probability-density-function-pdf-tp3897055p3898183.html

Re: [R] Labels in ICLUST

2011-10-12 Thread William Revelle
On Oct 11, 2011, at 2:28 AM, Steve Powell wrote: > Dear all, > I can't get the labels slot in ICLUST to accept a character vector. > library(psych) > test.data <- Harman74.cor$cov > ic.out <- ICLUST(test.data,nclusters > =4,labels=letters[1:ncol(test.data)]) ## Error in !labels : invalid > argume

Re: [R] labels in a boxplot

2011-10-12 Thread Francesco Sarracino
Hi Petr, thanks a lot for your reply. Unfortunately, your suggestion does not work for me. I even tried larger boxes such as 15,15 , but the result does not change. Is there some setting that I am missing? However, once more thanks a lot for your help. f. On 12 October 2011 15:58, Petr PIKAL wrot

Re: [R] labels in a boxplot

2011-10-12 Thread Francesco Sarracino
Thanks a lot Andrés. It was easier than I expected. f. 2011/10/12 Andrés Aragón > Francesco, > > Try cex.axis=0.6 > > Regards, > > Andrés AM > > 2011/10/12, Francesco Sarracino : > > Dear R-listers, > > > > I have a little problem with a boxplot and I hope you can help me > figuring > > it out.

[R] Odp: labels in a boxplot

2011-10-12 Thread Petr PIKAL
> > Dear R-listers, > > I have a little problem with a boxplot and I hope you can help me figuring > it out. > I'll try to make up some data to illustrate the issue. Sorry, if my > procedures look naive, but these are my first steps in R. Any comments > and/or suggestions are very welcome. > >

  1   2   >