Estadistica

Páginas: 50 (12468 palabras) Publicado: 26 de septiembre de 2012
Excerpts from the R Cookbook

25 Recipes for

Getting Started with

R

Paul Teetor

25 Recipes for Getting Started with R

25 Recipes for Getting Started with R

Paul Teetor

Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo

25 Recipes for Getting Started with R
by Paul Teetor
Copyright © 2011 Paul Teetor. All rights reserved. Printed in the United States ofAmerica. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com.

Editor: MikeLoukides Production Editor: Adam Zaremba Proofreader: Adam Zaremba Printing History:
February 2011: First Edition.

Cover Designer: Karen Montgomery Interior Designer: David Futato Illustrator: Robert Romano

Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. 25 Recipes for Getting Started with R, the image of a harpy eagle, andrelated trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation ofthis book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.

ISBN: 978-1-449-30323-5 [LSI] 1296229980

Table of Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii The Recipes . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 Downloading and Installing R Getting Help on a Function Viewing the Supplied Documentation Searching the Web for Help Reading Tabular Datafiles Reading fromCSV Files Creating a Vector Computing Basic Statistics Initializing a Data Frame from Column Data Selecting Data Frame Columns by Position Selecting Data Frame Columns by Name Forming a Confidence Interval for a Mean Forming a Confidence Interval for a Proportion Comparing the Means of Two Samples Testing a Correlation for Significance Creating a Scatter Plot Creating a Bar Chart Creating a BoxPlot Creating a Histogram Performing Simple Linear Regression Performing Multiple Linear Regression Getting Regression Statistics Diagnosing a Linear Regression Predicting New Values Accessing the Functions in a Package 1 3 4 6 8 10 12 13 16 17 21 22 23 24 26 28 29 30 32 33 34 36 39 42 43

v

Preface

R is a powerful tool for statistics, graphics, and statistical programming. It is used bytens of thousands of people daily to perform serious statistical analyses. It is a free, open source system whose implementation is the collective accomplishment of many intelligent, hard-working people. There are more than 2,000 available add-ons, and R is a serious rival to all commercial statistical packages. But R can be frustrating. It’s not obvious how to accomplish many tasks, even simpleones. The simple tasks are easy once you know how, yet figuring out the “how” can be maddening. This is a book of how-to recipes for beginners, each of which solves a specific problem. The recipe includes a quick introduction to the solution, followed by a discussion that aims to unpack the solution and give you some insight into how it works. I know these recipes are useful and I know they work...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Estadistica
  • Estadistica
  • Estadistica
  • Estadistica
  • Estadistica
  • Estadisticas
  • Estadistica
  • Estadistica

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS