Ulrich Kaiser
2006-Dec-21 14:15 UTC
[R] data -> data matrix that can be used in regressions
Dear R users, I have spent most of this day figuring out how to read STATA data into R (which eventually worked) and to run a simple OLS regression. It seems that the manuals are written in the most general and abstract way which does not really make it easy to understand what's going on. I'd be glad if somebody could save my day by: telling me how to define a matrix from the variables I read into R's memory, supposing that the variable are "lkiosk" and "lvisits". Thank you very much! Best regards, Uli *********************************************************** Ulrich Kaiser, Dr. rer. pol. Professor of Econometrics and its Applications Dept. of Business and Economics University of Southern Denmark at Odense Campusvej 55 5230 Odense M Phone: +45 6550 3363 Fax: +45 6615 8790 http://www.sam.sdu.dk/staff/uka [[alternative HTML version deleted]]
--- Ulrich Kaiser <uka at sam.sdu.dk> wrote:> Dear R users,> I have spent most of this day figuring out how to > read STATA data into R > (which eventually worked) and to run a simple OLS > regression. It seems > that the manuals are written in the most general and > abstract way which > does not really make it easy to understand what's > going on. > > I'd be glad if somebody could save my day by: > > > > telling me how to define a matrix from the variables > I read into R's > memory, supposing that the variable are "lkiosk" and > "lvisits".Mymatrix <- cbind(lkiosk,lvisits) Do a class(Mymatrix) to check this. You might find a simple tutorial like http://www.math.ilstu.edu/dhkim/Rstuff/Rtutor.html to be of help. I certainly have.
Gabor Grothendieck
2006-Dec-21 15:17 UTC
[R] data -> data matrix that can be used in regressions
Do a google search for cran contributed documentation and at the first hit you will find numerous introductions that may be of use to you. Also read the last line of every post to r-help. On 12/21/06, Ulrich Kaiser <uka at sam.sdu.dk> wrote:> Dear R users, > > > > I have spent most of this day figuring out how to read STATA data into R > (which eventually worked) and to run a simple OLS regression. It seems > that the manuals are written in the most general and abstract way which > does not really make it easy to understand what's going on. > > > > I'd be glad if somebody could save my day by: > > > > telling me how to define a matrix from the variables I read into R's > memory, supposing that the variable are "lkiosk" and "lvisits". > > > > Thank you very much! > > > > Best regards, > > > > Uli > > > > > > *********************************************************** > > Ulrich Kaiser, Dr. rer. pol. > > Professor of Econometrics and its Applications > > Dept. of Business and Economics > > University of Southern Denmark at Odense > > Campusvej 55 > > 5230 Odense M > > Phone: +45 6550 3363 > > Fax: +45 6615 8790 > > http://www.sam.sdu.dk/staff/uka > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >