Muenchen / Hilbe | R for Stata Users | E-Book | sack.de
E-Book

E-Book, Englisch, 549 Seiten, eBook

Reihe: Statistics and Computing

Muenchen / Hilbe R for Stata Users


1. Auflage 2010
ISBN: 978-1-4419-1318-0
Verlag: Springer US
Format: PDF
Kopierschutz: 1 - PDF Watermark

E-Book, Englisch, 549 Seiten, eBook

Reihe: Statistics and Computing

ISBN: 978-1-4419-1318-0
Verlag: Springer US
Format: PDF
Kopierschutz: 1 - PDF Watermark



Stata is the most flexible and extensible data analysis package available from a commercial vendor. R is a similarly flexible free and open source package for data analysis, with over 3,000 add-on packages available. This book shows you how to extend the power of Stata through the use of R. It introduces R using Stata terminology with which you are already familiar. It steps through more than 30 programs written in both languages, comparing and contrasting the two packages' different approaches. When finished, you will be able to use R in conjunction with Stata, or separately, to import data, manage and transform it, create publication quality graphics, and perform basic statistical analyses.A glossary defines over 50 R terms using Stata jargon and again using more formal R terminology. The table of contents and index allow you to find equivalent R functions by looking up Stata commands and vice versa. The example programs and practice datasets for both R and Stata are available for download.
Muenchen / Hilbe R for Stata Users jetzt bestellen!

Zielgruppe


Professional/practitioner

Weitere Infos & Material


Installing and Updating R.- Running R.- Help and Documentation.- Programming Language Basics.- Data Acquisition.- Selecting Variables.- Selecting Observations.- Selecting Variables and Observations.- Data Management.- Enhancing Your Output.- Generating Data.- Managing Your Files and Workspace.- Graphics Overview.- Traditional Graphics.- Graphics with ggplot2.- Statistics.- Conclusion.


"5 Programming Language Basics (p. 45-46)

5.1 Introduction

R is an object-oriented language. Everything that exists in it — variables, data sets, functions (commands) — are all objects. Stata has limitations on command and variable name lengths, based on the version of the software being used. The limits are large, though, and rarely result in a problem for Stata users. In Stata, leading periods in names are not allowed and data set names cannot have periods at all. Object names in R can be any length consisting of letters, numbers, underscores “ ,” or the period “.” and should begin with a letter. However, in R if you always put quotes around a variable or data set name (actually any object name), it can then contain any characters, including spaces.

Case matters in both R and Stata, so you can have two variables—one named myvar and another named MyVar—in the same data set, although that is not a good idea! Some add-on packages tweak function names like the capitalized “Save” to represent a compatible, but enhanced, version of a built-in function like the lowercased “save.” As in any statistics package, it is best to avoid names that match function names like “mean” or that match logical conditions like “TRUE.”

Commands can begin and end anywhere on a line and R will ignore any additional spaces. R will try to execute a function when it reaches the end of a line. Therefore, to continue a function call on a new line, you must ensure that the fragment you leave behind is not already a complete function call by itself. Continuing a function call on a new line after a comma is usually a safe bet. As you will see, R functions frequently use commas, making them a convenient stopping point.

The R console will tell you that it is continuing a line when it changes the prompt from “>” to “+.” If you see “+” unexpectedly, you may have simply forgotten to add the ?nal close parenthesis, “).” Submitting only that character will then ?nish your function call. If you are getting the “+” and cannot ?gure out why, you can cancel the pending function call with the Escape key on Windows or CTRL-C on Macintosh or Linux/UNIX. For CTRL-C, hold the CTRL key down (Linux/UNIX) or the control key (Macintosh) while pressing the letter C. You may end any R function call with a semicolon. That is not required though, except when entering multiple function calls on a single line."



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.