[R] How do I solve a disk I/O error with RSQLite?

2013-02-11 Thread chen jia
Hi there, I had an error when using RSQLite. My code and the error message are the following: > dbGetQuery(sql.dispersion, +"create table monthly_data_temp as + select a.*, b.industry + from monthly_data as a left join +siccd_industry_ff49

Re: [R] Data type problem when extract data from SQLite to R by using RSQLite

2011-03-01 Thread chen jia
t 1:16 AM, Seth Falcon wrote: > Hi Jia, > > On Mon, Feb 28, 2011 at 6:57 PM, chen jia wrote: >> The .schema of table annual_data3 is >> sqlite> .schema annual_data3 >> CREATE TABLE "annual_data3"( >>  PERMNO INT, >>  DATE INT, >>  CUSIP TEXT,

Re: [R] Data type problem when extract data from SQLite to R by using RSQLite

2011-02-28 Thread chen jia
apply(dbGetQuery(sql.industry, +"select RET from annual_data3 + where RET is not null limit 5"), +typeof) RET "double" I still don't know how to solve this problem for variable pya_var, please help. Thanks. Best, Jia On Mon, Fe

[R] Data type problem when extract data from SQLite to R by using RSQLite

2011-02-28 Thread chen jia
Hi there, When I extract data from SQLite to R, the data types (or modes) of the extracted data seems to be determined by the value of the first row. Please see the following example. When I put the missing values first, the column extracted is of the mode character. > str(dbGetQuery(sql.industry

[R] How do I move axis labels closer to plot box?

2010-07-12 Thread chen jia
Hi there, I place a vector of strings as labels at the tick points by using axis(1,at=seq(0.1,0.7,by=0.1), labels=paste(seq(10,70,by=10),"%",sep=""), tick=FALSE) However, there is a large space between those labels and the boundary of plot box. I want to reduce this space so that the labels appe

Re: [R] How do I test against a simple null that tworegressions coefficients are equal?

2010-07-08 Thread chen jia
   Ho: R2 = R1 >>    H1: R2 != R1 >>    that's a different test from what you did but i think it's what you >> want. >> >>    On Jul 8, 2010, chen jia wrote: >> >>      Thanks, Chuck. I am reading the references, which are helpful. >>    

Re: [R] How do I test against a simple null that two regressions coefficients are equal?

2010-07-08 Thread chen jia
> that's a different test from what you did but i think it's what you want. > > > > > On Jul 8, 2010, chen jia wrote: > > Thanks, Chuck. I am reading the references, which are helpful. > > Just to understand what I have done wrong here, > > I proposed a

Re: [R] How do I test against a simple null that two regressions coefficients are equal?

2010-07-08 Thread chen jia
equation. Is it this the same test as y = a1 + b1*x + e1 y = a2 + b2*x + e2 test alternative hypothesis b1 != b2 against null hypothesis b1 = b2. Best, Jia On Wed, Jul 7, 2010 at 11:12 PM, Charles C. Berry wrote: > On Wed, 7 Jul 2010, chen jia wrote: > >> Hi there, >> >> I run

[R] How do I test against a simple null that two regressions coefficients are equal?

2010-07-07 Thread chen jia
Hi there, I run two regressions: y = a1 + b1 * x + e1 y = a2 + b2 * z + e2 I want to test against the null hypothesis: b1 = b2. How do I design the test? I think I can add two equations together and divide both sides by 2: y = 0.5*(a1+a2) + 0.5*b1 * x + 0.5*b2 * z + e3, where e3 = 0.5*(e1 + e2

Re: [R] Pairwise combination

2010-05-11 Thread chen jia
1 May 2010 4:27:01 pm David Winsemius wrote: >> > On May 11, 2010, at 1:45 PM, chen jia wrote: >> > > Hi there, >> > > >> > > I am looking for a function that takes a vector as input and generates >> > > all pair wise combination of the element

Re: [R] Regressions with fixed-effect in R

2010-05-11 Thread chen jia
Thanks. I have the PDF document that you suggest. It is very brief on fixed-effect in panel regressions. I will look into plm package. Best, Jia On Tue, May 11, 2010 at 8:19 AM, Liviu Andronic wrote: > On 5/11/10, chen jia wrote: >>  Are there any functions that specifically deal w

[R] Pairwise combination

2010-05-11 Thread chen jia
Hi there, I am looking for a function that takes a vector as input and generates all pair wise combination of the elements of the input vector. For example, the input vector is c(1,2,3,4). The output vector is c(1 and 2, 1 and 3, 1 and 4, 2 and 3, 2 and 4, 3 and 4). The representation here is gen

[R] Regressions with fixed-effect in R

2010-05-10 Thread chen jia
Hi there, Maybe people who know both R and econometrics will be able to answer my questions. I want to run panel regressions in R with fixed-effect. I know two ways to do it. First, I can include factor(grouping_variable) in my regression equation. Second, I plan to subtract group mean from my va