[R] strucchange w dummy variables

2014-03-10 Thread Geoffrey Smith
Hello, I am having trouble with the output from the strucchange package for a dummy variable regression. Why do I still get an intercept term in the output of lm03, below? library(lmtest) library(strucchange) data(GermanM1) #regular dummy regression with intercept lm01 - lm(m ~

[R] Structural break test Andrews (2003)

2013-11-25 Thread Geoffrey Smith
Dear Friends, I am looking for an R version of the structural break test in Andrews (2003). The excellent strucchange package does not include this test (yet?). Is this test available in another package? If not, might there already be a function written to do this test? Thank you very much.

[R] strucchange breakpoints r-squared

2013-01-20 Thread Geoffrey Smith
Can anyone please tell me how to get the r-squared output from a piecewise (segmented) regression using the strucchange package? Here is the R code I have tried thus far. library(lmtest) library(strucchange) data - ts(c(rnorm(30), runif(30)), frequency = 12, start = c(2005, 01)) bpts -

[R] data.table vs plyr reg output

2012-06-26 Thread Geoffrey Smith
Hello. The data.table package is very helpful in terms of speed. But I am having trouble actually using the output from linear regression. Is there any way to get the data.table output to be as pretty/useful as that from the plyr package? Below is an example. library('data.table');

[R] grouping function

2012-05-08 Thread Geoffrey Smith
Hello, I would like to write a function that makes a grouping variable for some panel data . The grouping variable is made conditional on the begin year and the end year. Here is the code I have written so far. name - c(rep('Frank',5), rep('Tony',5), rep('Edward',5)); begin - c(seq(1990,1994),

[R] days between dates

2011-05-23 Thread Geoffrey Smith
Hello, I have some unbalanced panel data that is measured on weekdays only (i.e., excluding Saturday and Sunday). I would like to get the number of days between dates such that the number of days between a Friday and a Monday is 1 (and not 3). Here is some code to illustrate my problem:

Re: [R] days between dates

2011-05-23 Thread Geoffrey Smith
Thank you for the email. The data is unbalanced, meaning that some days are missing. So the sequence of days could be something like Tuesday, Wednesday, Friday, Monday. The diff function would produce 1, 2, 3. But I would like it to produce 1, 2, 1 since there is really only 1 day between

[R] bind mean to a df

2011-04-11 Thread Geoffrey Smith
Hello, I would like to take the mean of a column from a data frame and then bind the mean back to the data frame. I can do this using the following lines of code, but I am looking for a more elegant solution. Thank you very much. Geoff name -

[R] lags for unbalanced panel data

2011-03-08 Thread Geoffrey Smith
that accounts for the missing data?; #Notice that Tony is missing data for the Year 2007 and Edward is missing the Year 2005; #Note as well that we will need to end up losing the Year 2005 in the calculation; -- Geoffrey Smith Visiting Assistant Professor Department of Finance W. P. Carey School

[R] tapply output

2010-10-06 Thread Geoffrey Smith
ATom62.5 #0 BJane58.5 #1 AEnzo 66.5 #1 BMary 70.5 -- Geoffrey Smith Visiting Assistant Professor Department of Finance W. P. Carey School of Business Arizona State University [[alternative

[R] normality tests

2010-08-11 Thread Geoffrey Smith
Hello, does anyone know how to compute the following two normality tests using R: (1) the Kiefer-Salmon (1983) statistic, Economics Letters 11, p. 123-127 (2) the modified Shapiro-Wilk statistic? Thank you very much. Geoff [[alternative HTML version deleted]]

[R] mgcv out of memory

2010-06-27 Thread Geoffrey Smith
Hello, I am trying to update the mgcv package on my Linux box and I keep getting an Out of memory! error. Does anyone know of a fix for this? Below is a snippet of the message that I keep getting: Thank you. Geoff ** R ** inst ** preparing package for lazy loading ** help *** installing help

[R] percent by subset

2010-05-02 Thread Geoffrey Smith
Suppose my data looks like this: Obs, Male, Female, Height 1, T, F, 66 2, F, T, 64 3, T, F, 59 4, T, F, 55 5, F, T, 62

[R] panel data

2010-04-02 Thread Geoffrey Smith
in the missing YEAR such that the end result will be balanced and look like: ID,YEAR,HEIGHT Tom,2007,65 Tom,2008,66 Mary,2007,45 Mary,2008,50 Harry,2007,62 Harry,2008,62 James,2007,68 James,2008,NA Jack,2007,70 Jack,2008,NA Jordan,2007,NA Jordan,2008,72 Thank you. Geoff -- Geoffrey Smith Visiting

[R] mean for subset

2010-01-05 Thread Geoffrey Smith
, but not for Dawn and Clara? Thank you. -- Geoffrey Smith Visiting Assistant Professor Department of Finance W. P. Carey School of Business Arizona State University [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

[R] memisc package and rounding

2008-08-29 Thread Geoffrey Smith
Greetings, Is there a way to control the number of digits after the decimal from linear regression output using the memisc package? I have tried the following code, but it does not work: fm - lm(y ~ X) mtable(fm, digits=9) The default seems to be 3 digits after the decimal. Also, is there a

[R] survival package test stats

2008-07-02 Thread Geoffrey Smith
Geoffrey Smith Visiting Assistant Professor Department of Finance University of Illinois at Urbana-Champaign __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting