Displaying 20 results from an estimated 600 matches similar to: "Bug? in summary( ) function base package"
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
2007 Nov 28
2
extracting year an month from ts data set
I have an ascii data set of monthly observation starting in Jan 1946 with a
header.
hstarts
57
65
95
103
103
97
94
.
.
.
Which I read with the following code
tab6.1<-ts(read.table(fname, header=TRUE),frequency=12,start=c(1946,1))
I would like to run a time series model with dummy variables for each month.
If I had a variable which take values from 1 to 12 indicating the month I
could use
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.
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
2005 Mar 16
2
How to concatenate time series?
Hello,
I have just completed first experiments in using R, especially creating and
using ARIMA models, e.g.
# create a model as in example(arima)
fit <- arima(USAccDeaths, order = c(1,1,1),seasonal = list(order=c(1,1,1)))
# use the model to generate a prediction
dp<-predict(fit, n.ahead = 24)
plot(dp$pred) # view the prediction
Now I created a combined chart of the original and
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
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
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
2003 Mar 11
1
about yesterday predicted values
I don't understand where is my problem. I tried the problem
suggested by Prof. Brian Ripley
data(USAccDeaths, package="ts")
and it worked. So this is not a machine or configuration
problem. This is my series (dataset1.ts)
Jan Feb Mar Apr May Jun
Jul Aug
1998 20957656 22280838 28048581 32286754 36456729 35575315
34127179 34363108
1999
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
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
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
2011 Nov 08
3
window?
Can someone enlighten me on why the following doesn't work?
setwd('C:/Temp/R')
d <- rep(1:53,2)
(s <- ts(d, frequency=53, start=c(2000,10)))
n <- length(s)
k <- n%/%3
for(i in (n-k):n)
{
st <- c(start(s)[1] + (start(s)[2] + i)%/%frequency(s), (start(s)[2] +
i) %% frequency(s))
ed <- c(start(s)[1] +
2016 Apr 24
0
Inserting a blank row to every other row
Hi Saba,
I don't know how to do what you want and I also cannot see why.
If you describe what you hope to achieve there might be a different
solution.
Best wishes
Ulrik
Saba Sehrish via R-help <r-help at r-project.org> schrieb am So., 24. Apr.
2016 14:04:
> Hi
>
> I need to insert a blank row after every row in R data frame. I have
> achieved it through:
>
>
>
2009 Mar 05
2
Overriding contributed package functions
The "tsdiag" function in the TSA package overrides the "tsdiag" function in
the "stats" package. There are a few annoying bugs in the TSA's version of
the function so I would like to use the "stats" function but still have
access to other TSA functions. I have tried using stats::tsdiag( ) but as
long as the TSA package is attached the function from
2016 Apr 10
1
working with unequal rows
Hi
I have a data frame with rows specifying companies (codes are assigned to companies) and columns specify months (monthly data). The data is based on male (M) and female (F) information for each month. Following is an example of how my data looks like:
01 02 03 04
001 M M M na
001 F M M M
002 M na F F
003 F F F M
003 F F M na
003 M