[R] matrix with standard errors of lm model

2013-08-08 Thread iza.ch1
Hi Can someone give me a hint on how to create a matrix with standard errors from lm model? I have already managed to get the matrix with coefficients: coef-as.data.frame(sapply(seq_len(ncol(es.w)),function( i) {x1- summary(lm(es.w[,i]~es.median[,i]));x1$coef[,1]})) but I can't get the one

[R] t.test error

2013-08-08 Thread iza.ch1
Hi I receive a very strange error message after trying to do t-test. When I write the code t.test(x) I get an error message: error in t.test(x) : function sqr not found I don't understand this problem. Can someone help me how to do it right? Thanks a lot :)

[R] replace Na values with the mean of the column which contains them

2013-07-29 Thread iza.ch1
Hi everyone I have a problem with replacing the NA values with the mean of the column which contains them. If I replace Na with the means of the rest values in the column, the mean of the whole column will be still the same as if I would have omitted NA values. I have the following data de

[R] linear fit function with NA values

2013-07-27 Thread iza.ch1
Hi Quick question. I am running a multiple regression function for each column of two data sets. That means as a result I get several coefficients. I have a problem because data that I use for regression contains NA. How can I ignore NA in lm function. I use the following code for regression:

Re: [R] linear fit function with NA values

2013-07-27 Thread iza.ch1
(seq_len(ncol(dat1)),function(i) {try(lm(dat2[,i]~dat1[,i]))}) #works in the above case.  It may not work in your case. You need to provide a reproducible example to understand the situation better. A.K. - Original Message - From: iza.ch1 iza@op.pl

[R] do not perform function if the outcome is NA

2013-07-23 Thread iza.ch1
Hi you all I have a question regarding the function. In my function I divide the values by the standard errors and sometimes the standard error is equal to zero and I get the result NA. Can I write the function in the way that if the outcome of the function is zero then the function is not

Re: [R] do not perform function if the outcome is NA

2013-07-23 Thread iza.ch1
]/standard.deviation[i,1] }) Hope this helps, Rui Barradas Em 23-07-2013 22:58, iza.ch1 escreveu: Hi you all I have a question regarding the function. In my function I divide the values by the standard errors and sometimes the standard error is equal to zero and I get

[R] create data frame with coefficients from many regressions

2013-07-22 Thread iza.ch1
Hi ! I want to ask if somebody knows the way to create data frame with coefficients from many regressions I regress the first column from ret against the first columns from median, then the second with the second and so on. This is the code used for regression i-1:6

[R] Linear regression repeat for each column

2013-07-20 Thread iza.ch1
Hi everyone I need to calculate abnormal returns for different events applying event study methodology. I must create a market model in order to perform the analysis. I apply regression analysis to get OLS estimators. I have a problem to create a linear regression which I could repeat for each