Displaying 20 results from an estimated 20000 matches similar to: "Range difference of plot two arrays in one plot"
2013 Jan 22
6
plot two time series with different length and different starting point in one figure.
Hello,
I do have two different time series A and B, they are different in length and starting point. A starts in Jan, 2012 and ends in Dec, 2012 and B starts in March, 2012 and ends in Nov, 2012.
How can I plot those two series A and B in the same plot? I.E., from Jan. 2012 - Feb, 2012, it would have one data point from A and from Mar, 2012-Nov, 2012, it would have two data points from A and B,
2013 Mar 21
4
easy way of paste
Hello,
Is there a better way to use paste such as:
a = paste(colnames(list.indep)[1],colnames(list.indep)[2],colnames(list.indep)[3],colnames(list.indep)[4],colnames(list.indep)[5],sep="+")
> a
[1] "aa+dummy1+dummy2+bb+cc"
I tried
a = paste(colnames(list.indep)[1:5],sep="+")
> a
[1] "aa" "dummy1" "dummy2"
2013 Mar 21
2
How to store data frames into pdf file and csv file.
Hello,
I have a data frame
> mdl.summary
est.coef std.err t.stat
intercept 0.0011625517 0.0002671437 4.351784
aa -0.0813727439 0.0163727943 -4.969997
dummy1 -0.0002534873 0.0001204000 -2.105376
dummy2 -0.0007784864 0.0001437537 -5.415417
bb -0.0002856727
2013 Mar 20
3
How to look at the source code for predict()
Hello,
I try to look at the source code of predict() it turns out that I cannot find it.
I can see it with debug(library), but not efficient.
Can someone help?
Thanks,
Rebecca
----------------------------------------------------------------------
This message, and any attachments, is for the intended r...{{dropped:5}}
2013 Mar 22
4
error while extracting the p-value from adf.test
Hello all,
I tried to extract the p-value from adf.test in tseries; however, I got the error message such as
> ht=adf.test(list.var$aa)
> ht$p-value
Error in ht$p - value : non-numeric argument to binary operator
> ht
Augmented Dickey-Fuller Test
data: list.var$aa
Dickey-Fuller = -2.3147, Lag order = 4, p-value = 0.4461
alternative hypothesis: stationary
> ht$data
[1]
2013 Jan 18
2
A smart way to use "$" in data frame
Hello all,
I have a data frame dataa:
newdate newstate newid newbalance newaccounts
1 31DEC2001 AR 1 1170 61
2 31DEC2001 VA 2 4565 54
3 31DEC2001 WA 3 2726 35
4 31DEC2001 AR 3 2700 35
The following gives me the balance of state AR:
2013 May 28
1
The weak exogeneity test in R for the Error Correction Model?
Hello all,
I would like to carry out a single-equation approach of the Error Correction Model such as
Delta_y(t) = a + b*y(t-1) + c*x1(t-1) + d*x2(t-1) + e*delta_x1(t) + f*delta_x2(t) + epsilon(t)
Where, a, b, c, d, e, f are coefficients to be estimated, y is the dependent variable, and x1, x2 are independent variables.
For the single equation approach of ECM, there is a requirement of the
2011 Nov 02
1
difference between foo$a[2] <- 1 and foo[2,"a"] <- 1
Hallo
Can anyone tell me the difference between
foo$a[2] <- 1 and foo[2,"a"] <- 1 ?
I thought that both expressions are equivalent, but when I run the following example, there is obviously a difference.
> foo <- data.frame(a=NA,b=NA)
> foo
a b
1 NA NA
> foo$a[1] <- 1
> foo$b[1] <- 2
> foo$a[2] <- 1
Error in `$<-.data.frame`(`*tmp*`,
2013 Mar 19
4
How to get the t-stat for arima()?
Hello all,
fit = arima()
and
Summary(fit) will give some summary of the fit. However, the t-stats are not shown in the summary. How can I get the t-stats of it?
Thanks,
Rebecca
----------------------------------------------------------------------
This message, and any attachments, is for the intended r...{{dropped:5}}
2013 Jan 23
4
to check if a character string is in a group of character strings
Hello,
How can I judge if a string is in a group of string? For example, I would like to have
if (subpool in pool){
}else{
}
Where
> pool = c("s1","s2")
> subpool = c("s1")
How can I write the "subpool in pool" right in R?
Thanks very much!
Cheers,
Rebecca
----------------------------------------------------------------------
This message,
2013 Jan 02
3
suggestions about import SAS results to R.
Hello all,
I have got some data in SAS, and I export it to one excel workbook with multiple sheets, for example, each sheet has the sales information for each state. Then I need to use R to do plotting, analysis on those sales data, where I need to load the data from excel to R.
When I read the article at this link:
http://yihui.name/en/2009/09/how-to-import-ms-excel-data-into-r/
I am
2012 Apr 26
3
repeat matrix rows as a whole
Hi,
If I have a matrix like
1 2 3 4
5 6 7 8,
how can I repeat two rows as whole, to be like
1 2 3 4
5 6 7 8
1 2 3 4
5 6 7 8?
Since I have more two rows in a matrix and I need to repeat many times, I wonder whether there is a convenient command to do so.
Thanks!
[[alternative HTML version deleted]]
2013 Nov 25
2
Durbin Watson Test Bound in R
Hi,
How could I use R to check Durbin Watson Test Bound?
Best,
Rebecca
2007 Aug 02
2
y axix number into horizontal direction
Dear R users,
I used plot() and mtext() functions to draw a plot. The numbers: 0,20,35,
40,60,80,100 were in the vertical direction. I'd like to transfer them into
the horizontal direction.
plot(0,0,xaxt="n",type="n", ylim=c(0,100))
mtext("35",side=2,at=35)
Any suggestion?
Thanks.
Rebecca
[[alternative HTML version deleted]]
2013 Apr 08
2
Can I open an existing pdf file and attach result to it?
Hello all,
I would like to attach some results from R to an existing pdf file, can I do that through R?
Thanks,
Rebecca
----------------------------------------------------------------------
This message, and any attachments, is for the intended r...{{dropped:5}}
2013 Jan 30
1
fSeries not found in R
Hello all,
When I tried to install fSeries in R, I got the following error messages:
install.packages("fSeries",dependencies=T)
Warning message:
package 'fSeries' is not available (for R version 2.15.2)
Is this package changing/merging to another package?
Thanks,
Rebecca
----------------------------------------------------------------------
This message, and any
2013 Jan 16
2
How to cut the time format short
Hello all,
I have a time format looks like
31JAN2002:00:00:00.000
How could I cut it to
31JAN2002
?
I tried with format() but not work.
Thanks,
Rebecca
----------------------------------------------------------------------
This message, and any attachments, is for the intended r...{{dropped:5}}
2013 Mar 21
1
Could I get the following stats from arima()?
Hello all,
I use the arima to get a model, i.e.
fit = arima(x,order=c(1,0,0))
and I know I can get the following from fit via
est.coef = coef(fig)
est.aic = fit$aic
std.err = sqrt(diag(vcov(fit)))
t.stat = est.coef/std.err
How can I get the following stat from arima?
Pr(>|t|)
r2
adjust_r2
rmse
Thanks,
Rebecca
2011 Jan 12
2
plot: skip a range of axis
Hi,
I am using plot to show scatter points in 2_D.
in my data, there is no data between -1 and +1 in x-axis.
I want to skip this region, i.e. x axis becomes [-Inf:-1, 1:Inf].
can any one tell me how to do?
YU
[[alternative HTML version deleted]]
2013 Jan 14
3
readJPEG function cannot open jpeg files
I installed jpeg package and tried to use
kim<-readJPEG("kim.jpeg") to read in a jpeg file, but R gave me an error:
Error in readJPEG("kim.jpeg") : unable to open kim.jpeg
I already put "kim.jpeg" in Rstudio's default working directory: "E:\home
work\Rstudio". So I don't think it's a problem caused by omitting the file's
path. But I