similar to: extracting year an month from ts data set

Displaying 20 results from an estimated 2000 matches similar to: "extracting year an month from ts data set"

2007 Dec 05
1
Working with "ts" objects
I am relatively new to R and object oriented programming. I have relied on SAS for most of my data analysis. I teach an introductory undergraduate forecasting course using the Diebold text and I am considering using R in addition to SAS and Eviews in the course. I work primarily with univariate or multivariate time series data. I am having a great deal of difficulty understanding and working with
2008 Mar 30
2
convert weekly time series data to monthly
I have weekly time series data with year, month, day, and price variables. The input data set for the weekly series takes the following form: Year month day price 1990 8 20 119.1 1990 8 27 124.5 1990 9 3 124.2 1990 9 10 125.2 1990 9 17 126.6 1990 9 24 127.2 1990 10 1 132.1 1990 10 8 133.3 1990 10 15 133.9 1990 10 22 134.5 1990 10 29 133.9 .. ... ... ... ... ... .... .... 2008 3 3 313.7 2008
2010 Feb 07
2
Reading hierarchical data
I would like to read the following hierarchical data set. There is a family record followed by one or more personal records. If col. 7 is "1" it is a family record. If it is "2" it is a personal record. The family record is formatted as follows: col. 1-5 family id col. 7 "1" col. 9 dwelling type code The personal record is formatted as follows: col.
2013 Feb 26
1
problem with nested loops
Each of the data sets contains monthly observations on price indices for 7 countries. I use the fitted values from reg1 in the reg2 model. The interior loop executes without error as long as I explicitly specify the data set, i.e. data=dat70. However the code fails to execute if I specify the model in the form of the commented line, i. e reg1 <-dynlm(form1,data=Dnames[j]) I get the following
2008 Apr 30
2
Bug? in summary( ) function base package
There seems to be an error in the summary() function when applied to "ts" class objects. The results of a call to summary( ), on the R "ts" data set USAccDeaths , reports the wrong value for Max. The value reported by the summary function is 11320. The max( ) function returns the correct value 11317, the July 1993 value. Coercing the data to a data.frame and calling summary
2008 Jan 03
1
R procedure similar to STATA heckprob?
Is anyone aware of an R procedure similar to STATA's "heckprob" procedure? "Heckprob" fits maximum likelihood probit models correcting for sample selection bias. Thanks, Richard Saba Department of Economics Auburn University Email: sabaric@auburn.edu [[alternative HTML version deleted]]
2008 Mar 21
1
tseries(arma) vs. stats(arima)
Hello, The "arma" function in the "tseries" package allows estimation of models with specific "ar" and "ma" lags with its "lag" argument. For example: y[t] = a[0] + a[1]y[t-3] +b[1]e[t-2] + e[t] can be estimated with the following specification : arma(y, lag=list(ar=3,ma=2)). Is this possible with the "arima" function in the
2008 Feb 12
2
Formulae for R functions
Can someone direct me to a resource or resources that list the formulae used by R functions (i.e. predict.lm ) to calculate the statistic reported. I am not a programmer and studying the r code is extremely slow going. I have searched r-project.org and all the function help files without success. For example I have attempted to replicate by hand the se.fit calculation from a lm object
2013 May 20
1
Objects created by more than one data call?
Hello, All: If I use LazyData with the Ecdat package on R-Forge, "R CMD check" reports "no visible binding for global variable 'nonEnglishNames'", where 'nonEnglishNames' is a dataset in Ecdat used as the default argument for a function. With LazyData, that NOTE disappears. However, then I get, "Warning: objects 'Hstarts',
2010 Apr 08
1
reshape panel data
I have a data set with observations on 549 cities spanning an 18 year period. However, some of cities did not report in one or more of the 18 years. I would like to implement the procedure suggested by Wooldridge section 17.1.3 in his "Econometric analysis of cross section and panel data" to correct for attrition. For example the table below indicates that the 3rd and the 7th cities in
2008 Jan 11
1
question about xreg of arima
Hi, I am trying to understand exactly what xreg does in arima. The documentation for xreg says:"xreg Optionally, a vector or matrix of external regressors, which must have the same number of rows as x." What does this mean with regard to the action of xreg in arima? Apparently somehow xreg made the following two arima fit equivalent in R: arima(x, order=c(1,1,1), xreg=1:length(x)) is
2007 Oct 26
1
Newey-West and SUR regression models
Is anyone aware of a procedure to apply Newey-West corrections for autocorrelation to a SUR regression model? The SANDWICH package seems to be applicable only to LM or GLM models. Thanks, Richard Saba Department of Economics Auburn University Email: sabaric at auburn.edu
2011 Feb 22
2
Calculate a mean for several months for several years
Hello everyone, I have a dataset with 3 colums (Year, Month, MeanTemp). Now I would like to calculate the average of the mean temperature for the summer months (Juli, August, September) for each of the 20 years. I'm sure it's somehow possible with a loop, but all I tried so far didn't worked and by the time I spent looking for a solution I would have even be faster doing this in
2007 Mar 24
2
Two Problems while trying to aggregate a dataframe
Hello! Given is an Excel-Sheet with actually 11,000 rows and 9 columns. I want to work with the data in R. The contents are similar to my following example. I have a list with ID-number, personal name and two kinds of loan-values. I want to aggregate the list, that for each person only one row remains and where the loan-values are added. First I tried some commands with tapply but had no
2016 Apr 24
2
Inserting a blank row to every other row
Hi I need to insert a blank row after every row in R data frame. I have achieved it through: df[rep(1:nrow(df),1,each=2),] But it inserts a row with name of previous row, while i want a complete blank row without any name/title. Please guide me Regards Saba
2016 Apr 22
2
Finding Highest value in groups
Hi I have two columns in data frame. First column is based on "ID" assigned to each group of my data (similar ID depicts one group). From second column, I want to identify highest value among each group and want to assign the same ID to that highest value. Right now the data looks like: ID Value 1 0.69 1 0.31 2 0.01 2 0.99 3 1.00 4 NA 4
2010 Jan 16
2
predict.glm
Hi, See below I reply your message for <https://stat.ethz.ch/pipermail/r-help/2008-April/160966.html>[R] predict.glm & newdata posted on Fri Apr 4 21:02:24 CEST 2008 You say it ##works fine but it does not: if you look at the length of yhat2, you will find 100 and not 200 as expected. In fact predict(reg1, data=x2) gives the same results as predict(reg1). So I am still looking for
2016 Apr 24
2
Inserting a blank row to every other row
Well, something like this would work (there may be slicker solutions): > z <- data.frame(a=1:3,b = letters[1:3]) > i <- seq_len(nrow(z)) *2 > z <-rbind(z,z) > z[i, ] <- matrix(NA, nr=nrow(z),nc=ncol(z)) > z a b 1 1 a 2 NA <NA> 3 3 c 4 NA <NA> 5 2 b 6 NA <NA> But I agree with you that there is probably a way to handle the underlying
2017 Feb 02
3
Register allocator behaves differently when compiling with and without -g
Hi all, In several of our tests, I have noticed that the register allocator allocates to virtual registers in a different order when compiling with the clang option -g. Before entering the register allocator, the code is identical when compiling with and without -g (with the exception of " DBG_VALUE" instructions). The only difference I can see is the value assigned to the slot index
2009 Jan 19
2
[LLVMdev] HazardRecognizer and RegisterAllocation
Hi list, in our LLVM-based-project we are writing a backend for our processor. The architecture is a quite straight-forward RISC, but it does not have hardware interlocks, i.e. data hazards involving memory access must be resolved by the compiler, either by scheduling unrelated instructions or by inserting NOOPs into the load delay slots: ---- For example, code which looks like that: load