[R] combining arima and ar function

2011-12-01 Thread Samir Benzerfa
Hi everyone I've got a problem regarding the arima() and the ar() function for autoregressive series. I would simply like to combine them. To better understand my question, I first show you how I'm using these two functions individually (see file in the attachement). 1)

Re: [R] question R regarding consecutive numbers

2011-10-28 Thread Samir Benzerfa
(1,3,4,9,1,9,1,5,4,5,2,1,1,1,6) Any ideas how to solve this problem? Cheers, S.B. -Ursprüngliche Nachricht- Von: David Winsemius [mailto:dwinsem...@comcast.net] Gesendet: Donnerstag, 27. Oktober 2011 16:44 An: Duncan Murdoch Cc: Samir Benzerfa; r-help@r-project.org Betreff: Re: [R] question R regarding

[R] Gap in solution

2011-10-28 Thread Samir Benzerfa
(1,3,4,9,1,9,1,5,4,5,2,1,1,1,6) Any ideas how to solve this problem? Cheers, S.B. -Ursprüngliche Nachricht- Von: David Winsemius [mailto:dwinsem...@comcast.net] Gesendet: Donnerstag, 27. Oktober 2011 16:44 An: Duncan Murdoch Cc: Samir Benzerfa; r-help@r-project.org Betreff

[R] question R regarding consecutive numbers

2011-10-27 Thread Samir Benzerfa
Hi everyone Do you know about any possibility in R to check for consecutive numbers in vectors? That is, I do not only want to count the number of observations in total (which can be done table(x)), but I also want to count for instance how many times that vector contains a certain number

[R] question regarding intersect function

2011-10-25 Thread Samir Benzerfa
Hi I have probably a very simple question but I'm going crazy trying to find the solution. I have two data.frames with headers and I'm doing an intersection between them by names, such that the intersected data.frames are returned by: df1[intersect(names (df1), names(df2))] and the same

[R] delete columns which partially match expression

2011-10-13 Thread Samir Benzerfa
Hello everyone, I'd like to search for certain expressions (characters) in my data.frame and delete the containing columns. So, for example in the below table, I'd like to delete all columns which contain the expression Error. That is, R should delete column C and E from my data. Any

[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

[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] filtering rows

2011-10-11 Thread Samir Benzerfa
Hi everyone, I've got two data sets as below. My question now is: how can I use Dataset2 as a filter for Dataset1? My goal is just to keep the rows of Dataset1 where the first column (Date) matches the Dates in Dataset2. I would appreciate any solutions to this issue. Many thanks!

[R] creating subsets and calculating weights

2011-10-04 Thread Samir Benzerfa
Dear all, propably this question sounds stupid to you, but since I'm new to R I got some troubles regarding the following issue (The table below does not represent my real data, it is just a simplified example): My intention is to first subdivide my data into several groups of vectors,

[R] Sorting data in R according to the header of another table

2011-10-03 Thread Samir Benzerfa
Hi everyone, My (simplified) problem is the following one: I have two tables. The first table contains 5 columns with 5 values and the second table contains a single value for each vector name of the first table (see tables below): Table 1: A B C D

[R] Handling missing values

2011-09-28 Thread Samir Benzerfa
Hi everyone, I've got a question concerning missing values in R. I'm looking for an R code which removes all NA values in my data.frame. I found many answers about how to remove rows or columns which contain NA's. My problem however is a bit different. I have a list of vectors. Each vector

[R] Question concerning Box.test

2011-09-27 Thread Samir Benzerfa
Hi everyone, I've got a question concerning the function Box.test for testing autocorrelation in my data. My data consist of (daily) returns of several stocks over time (first row=time, all other rows=stock returns). I intend to perform a Box-Ljung test for my returns (for each stock).

[R] question concerning the acf function

2011-09-16 Thread Samir Benzerfa
Hi everyone, I've got a question concerning the function acf(.) in R for calculating the autocorrelation in my data. I have a table with daily returns of several stocks over time and I would like to calculate the autocorrelation for all the series (not only for one time series). How can I

[R] problems with function read.table

2011-09-08 Thread Samir Benzerfa
Hello everyone I have a couple of questions about the usage of the R function read.table(.). My point of departure is that I want to import a matrix (consisting of time and daily stock returns of many stocks) in R. Most of the data is numeric, however some values are missing (blanks) and in