[R] Rendo and dataMultilevelIV

2018-08-02 Thread cjg15
Hi - Does anyone know what the variables CID and SID are in the dataMultilevelIV dataset? The example from page 18-19 of https://cran.r-project.org/web/packages/REndo/REndo.pdf has formula1 <- y ~ X11 + X12 + X13 + X14 + X15 + X21 + X22 + X23 + X24 + X31 + X32 + X33 + (1 + X11 | CID) + (1|SID)

Re: [R] how to allign data

2018-08-02 Thread Jim Lemon
Hi Petr, I recently had to align the minima of deceleration events to form an aggregate "braking profile" for different locations. It seems as though you are looking for something like: find_increase<-function(x,surround=10) { inc_index<-which.max(diff(x))

Re: [R] kSamples ad.test question

2018-08-02 Thread Bert Gunter
You may get a response here, but as this is primarily a statistical question, not a question about R programming, so it is off topic here. I would suggest that you post this on stats.stackexchange.com or other statistics site instead. There is a large literature on this sort of thing . Cheers,

[R] kSamples ad.test question

2018-08-02 Thread Andras Farkas via R-help
Dear All, once we run the following code, the results of the test will give us the expected obvious, samples are from the common distribution... library(kSamples) u1 <- sample(rnorm(500,10,1),20,replace = TRUE) u2 <- sample(rnorm(500,10,1),20,replace = TRUE) u3 <-

Re: [R] Combinations of true/false values where one pair is mutually exclusive

2018-08-02 Thread Bert Gunter
Logic: !(E == "fail" & F == "fail) <==> (E == "pass" | F == "pass") -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Aug 2, 2018 at 8:57 AM,

Re: [R] Combinations of true/false values where one pair is mutually exclusive

2018-08-02 Thread Sarah Goslee
Given that clarification, I'd just generate the full set and remove the ones you aren't interested in, as in: scenarios <- expand.grid(A = c("pass", "fail"), B = c("pass", "fail"), C = c("pass", "fail"), D = c("pass", "fail"), E = c("pass", "fail"), F = c("pass", "fail")) scenarios <-

Re: [R] Combinations of true/false values where one pair is mutually exclusive

2018-08-02 Thread MacQueen, Don via R-help
From what I can tell, the simplest way is to First generate all the combinations Then exclude those you don't want. Here's an example, with only three variables (D, E, and F), that excludes those where E and F both fail > tmp <- c('p','f') > X <- expand.grid(D=tmp, E=tmp, F=tmp) > X <-

Re: [R] Combinations of true/false values where one pair is mutually exclusive

2018-08-02 Thread R Stafford
Thank you for pointing that out, I realize not only did I use the wrong language but I did not describe the situation accurately. I do need to address the situation where both variables E and F actually pass, that is the majority case, one or the other can fail, but there can never be a situation

Re: [R] Philip Morris International - Windows10 migration assessment

2018-08-02 Thread Bert Gunter
R is free and open source. Your queries are inappropriate for this list, which is about help for programming in R. Please go here and follow the relevant links to answer your questions: https://www.r-project.org/ Cheers, Bert Bert Gunter "The trouble with having an open mind is that people

[R] how to allign data

2018-08-02 Thread PIKAL Petr
Dear all Before I start to reinvent wheel I would like to ask you if you have some easy solution for aligning data I have something like this x<-1:100 set.seed(42) y1<-c(runif(20)+1, 1.2*x[1:80]+runif(80)) y2<-c(runif(40)+1, 1.2*x[1:60]+runif(60)) plot(x,y1) points(x,y2, col=2) with y

Re: [R] CODE HELP

2018-08-02 Thread Saptorshee Kanto Chakraborty
Hello, Thank you for replying. I am sorry te codes were not attached, I did attach them but I think it got blocked due to some filters. I am pasting the link for the codes: https://github.com/zhentaoshi/convex_prog_in_econometrics/tree/master/C-Lasso/PLS_static The authors never replied I have

Re: [R] Philip Morris International - Windows10 migration assessment

2018-08-02 Thread S Ellison
Suggest you take a look at the R website at www.r-project.org; the most important answers are evident there. If you 'require' more authoritative answers within a particular timescale, I suggest you engage an R consultant and pay for them. This is a voluntary list. S Ellison > -Original

Re: [R] Combinations of true/false values where one pair is mutually exclusive

2018-08-02 Thread S Ellison
> On Thu, Aug 2, 2018 at 11:20 AM, R Stafford > wrote: > > But I have the extra condition that if E is true, then F must be false, and > > vice versa, Question: Does 'vice versa' mean a) "if E is False, F must be True" or b) "if F is True, E must be False"? ... which are not the same. b) (and

[R] Philip Morris International - Windows10 migration assessment

2018-08-02 Thread Flament, Kevin
Dear R Project team, I am representing the System Toxicology department of Philip Morris International in the scope of a Windows 10 migration project. This project is currently at the end of the assessment phase. We would require an answer to this email by the end of this week. I would like to

[R] inconsistency in forecast package....

2018-08-02 Thread akshay kulkarni
dear members, I am using R to do my research for Day Trading in INDIA. I have a list of 206 stocks to work with. I have extracted a parameter of a stock based on the OHLC data of the stock. It includes values both less than and greater than 1 ( It basically is a

Re: [R] F-test where the coefficients in the H_0 is nonzero

2018-08-02 Thread peter dalgaard
This should do it: > x <- rnorm(10) > y <- x+rnorm(10) > fit1 <- lm(y~x) > fit2 <- lm(y~-1 + offset(0 + 1 * x)) > anova(fit2, fit1) Analysis of Variance Table Model 1: y ~ -1 + offset(0 + 1 * x) Model 2: y ~ x Res.Df RSS Df Sum of Sq F Pr(>F) 1 10 10.6381

Re: [R] read txt file - date - no space

2018-08-02 Thread PIKAL Petr
Hi Good that you have finally got desired result. Regarding aggregate, you could consult help page ?aggregate It has many good examples how to use it. and for understanding factors ?factor is your friend and/or pages 16+ from R intro. Cheers Petr From: Diego Avesani Sent: Thursday, August

Re: [R] read txt file - date - no space

2018-08-02 Thread Diego Avesani
Dear Petr, I have read the file: MyData <- read.csv(file="obs_prec.csv",header=TRUE, sep=",") I have used POSIXct to convert properly the date MyData$date2<-as.POSIXct(MyData$date, format="%m/%d/%Y %H:%M") creating a second field inside MyDate. I have converted the -999 to NA: MyData[MyData==

[R] F-test where the coefficients in the H_0 is nonzero

2018-08-02 Thread John
Hi, I try to run the regression y = beta_0 + beta_1 x and test H_0: (beta_0, beta_1) =(0,1) against H_1: H_0 is false I believe I can run the regression (y-x) = beta_0 +beta_1‘ x and do the regular F-test (using lm functio) where the hypothesized coefficients are all zero.

Re: [R] CODE HELP

2018-08-02 Thread Eric Berger
Hi Saptorshee, Two comments: 1. no attachments made it through to the list. You probably need to include the code directly in your email, and send your email as plain text (otherwise information gets stripped) 2. for anyone interested in following up on Saptorshee's question, I searched for the

Re: [R] read txt file - date - no space

2018-08-02 Thread Diego Avesani
Dear PIKAL, Dear all, thanks again a lot. I have finally understood what "in line" means. I would definitely read some "R-intro" and in this moment I am reading a R-tutorial. I would not post formatted messages. I would ask if it is possible to have some final suggestions: - how to have daily

Re: [R] read txt file - date - no space

2018-08-02 Thread PIKAL Petr
Well, you followed my advice only partly. Did you get rid of your silly -999 values before averaging? Probably not. Did you tried aggregating by slightly longer construction aggregate(test[,-1], list(format(test$date, "%Y-%m-%d")), mean) which keeps difference in month and year? Probably not.

Re: [R] read txt file - date - no space

2018-08-02 Thread Diego Avesani
Dear all, I have found and error in the date conversion. Now it looks like: MyData <- read.csv(file="obs_prec.csv",header=TRUE, sep=",") # change date to real MyData$date<-as.POSIXct(MyData$date, format="%*m*/%*d*/%Y %H:%M") After that I apply the PIKAL's suggestions: aggregate(MyData[,-1],

Re: [R] read txt file - date - no space

2018-08-02 Thread PIKAL Petr
Hi see in line (and please do not post HTML formated messages, it could be scrammbled) From: Diego Avesani Sent: Thursday, August 2, 2018 8:56 AM To: jim holtman ; PIKAL Petr Cc: R mailing list Subject: Re: [R] read txt file - date - no space Dear I have check the one of the line that

Re: [R] read txt file - date - no space

2018-08-02 Thread Diego Avesani
Dear I have check the one of the line that gives me problem. I mean, which give NA after R processing. I think that is similar to the others: 10/12/1998 10:00,0,0,0 10/12/1998 11:00,0,0,0 10/12/1998 12:00,0,0,0 10/12/1998 13:00,0,0,0 10/12/1998 14:00,0,0,0 10/12/1998 15:00,0,0,0 10/12/1998