Monday, November 7, 2011

Rlinx

Some useful R links (State of the R)

http://had.co.nz/plyr/plyr-intro-090510.pdf for data manipulation
http://www.stats.ox.ac.uk/~ruth/RCourse/Rcourse3.pdfhttp://cran.r-project.org/doc/contrib/usingR.pdf for R basics
http://www.ats.ucla.edu/stat/r/dae/default.htm with annotated outputs in R
http://cran.r-project.org/doc/contrib/Rossiter-RIntro-ITC.pdf tutorial with info on plots
http://www.statmethods.net/stats/regression.htmlhttp://www.rmetrics.org/ provides an Open Source framework for Financial Analysis.
http://www.econ.uiuc.edu/~econ472/e-Tutorial.html has lecture notes with R code
A brief guide to R and Economicshttp://people.su.se/~ma/R_intro/R_intro.pdfhttp://www.stat.pitt.edu/stoffer/tsa2/index.html has a good beginner’s tutorial for Time Series
http://www.quantmod.com/ provides a great analysis and visualization framework for quantitative trading
http://www.wise.xmu.edu.cn/2007summerworkshop/download/Advanced%20Topics%20in%20Time%20Series%20Econometrics%20Using%20R1_ZongwuCAI.pdf advanced time series in R
Interesting time series packages in R http://robjhyndman.com/software
A Data Mining tool in R http://rattle.togaware.com/
An online e-book for Data Mining with R http://www.liaad.up.pt/~ltorgo/DataMiningWithR/
Advanced Statistics using R http://www.statmethods.net/advstats/index.html
Guide to Credit Scoring using R http://cran.r-project.org/doc/contrib/Sharma-CreditScoring.pdfhttp://addictedtor.free.fr/graphiques/ is a graph gallery of R plots and charts with supporting code
A tutorial for Latticehttp://osiris.sunderland.ac.uk/~cs0her/Statistics/UsingLatticeGraphicsInR.htm
Ggplot R graphics http://had.co.nz/ggplot2/
Ggplot Vs Lattice @ http://had.co.nz/ggplot/vs-lattice.html
Multiple tutorials for using ggplot2 and Lattice http://learnr.wordpress.com/tag/ggplot2/
Introduction to the Text Mining package in R http://cran.r-project.org/web/packages/tm/vignettes/tm.pdf
Social Network Analysis http://www.r-project.org/conferences/useR-2008/slides/Bojanowski.pdf
Web Scraping in R http://www.programmingr.com/content/webscraping-using-readlines-and-rcurlhttp://learnr.wordpress.com/2009/10/06/export-data-frames-to-multi-worksheet-excel-file/ to embed R data frames in Excel via multiple approaches.
http://www.statconn.com/ provides a tool to make R usable from Excel
Connect to MySQL from R http://erikvold.com/blog/index.cfm/2008/8/20/how-to-connect-to-mysql-with-r-in-wndows-using-rmysqlhttp://www.statmethods.net/input/importingdata.htmlprovides info about pulling data from SAS, STATA, SPSS, etc.
Thematic Maps with R http://stackoverflow.com/questions/1260965/developing-geographic-thematic-maps-with-rhttp://smartdatacollective.com/Home/22052 for geographic maps in R
Google Charts with Rhttp://www.iq.harvard.edu/blog/sss/archives/2008/04/google_charts_f_1.shtml
Intro to using RGoogleMaps @ http://cran.r-project.org/web/packages/RgoogleMaps/vignettes/RgoogleMaps-intro.pdfhttp://www.stat.uni-muenchen.de/~leisch/Sweave/
R2HTML http://www.feferraz.net/en/P/R2HTML
Poor Man GUI for R http://wiener.math.csi.cuny.edu/pmg/
R Commander is a robust GUI for R http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/installation-notes.html
JGR is a Java-based GUI for R http://jgr.markushelbig.org/Screenshots.html
Tinn-R makes for a good R editor http://www.sciviews.org/Tinn-R/
An Eclipse plugin for R @ http://www.walware.de/goto/statet
Instructions to install StatET in Eclipsehttp://www.splusbook.com/Rintro/R_Eclipse_StatET.pdf
Komodo Edit R editor http://www.sciviews.org/SciViews-K/index.htmlhttp://www.omegahat.org/has a very interesting list of packages that is seriously worth a look
Commercial versions of R @ http://www.revolution-computing.com/
A very informative blog http://blog.revolution-computing.com/
Red R for R tasks http://code.google.com/p/r-orange/
KNIME for R http://www.knime.org/introduction/screenshots and is worth a serious look.
source: LinkedInRGroup with more

Sunday, October 2, 2011

R in Action

R in Action. Data Analysis and Graphics with R, Robert I. Kabacoff // August, 2011 | 472 pages, ISBN 9781935182399

Part I Getting Started
1 Introduction to R
1.1 Why use R?
1.2 Obtaining and installing R
1.3 Working with R
1.4 Packages
1.5 Batch processing
1.6 Using output as input—reusing results
1.7 Working with large datasets
1.8 Working through an example
1.9 Summary
2 Creating a dataset
2.1 Understanding datasets
2.2 Data structures
2.3 Data input
2.4 Annotating datasets
2.5 Useful functions for working with data objects
2.6 Summary
3 Getting started with graphs
3.1 Working with graphs
3.2 A simple example
3.3 Graphical parameters
3.4 Adding text, customized axes, and legends
3.5 Combining graphs
3.6 Summary
4 Basic data management
4.1 A working example
4.2 Creating new variables
4.3 Recoding variables
4.4 Renaming variables
4.5 Missing values
4.6 Date values
4.7 Type conversions
4.8 Sorting data
4.9 Merging datasets
4.10 Subsetting datasets
4.11 Using SQL statements to manipulate data frames
4.12 Summary
5 Advanced data management
5.1 A data management challenge
5.2 Numerical and character functions
5.3 A solution for our data management challenge
5.4 Control flow
5.5 User-written functions
5.6 Aggregation and restructuring
5.7 Summary
Part II Basic Methods
6 Basic graphs
6.1 Bar plots
6.2 Pie charts
6.3 Histograms
6.4 Kernel density plots
6.5 Box plots
6.6 Dot plots
6.7 Summary
7 Basic statistics
7.1 Descriptive statistics
7.2 Frequency and contingency tables
7.3 Correlations
7.4 t-tests
7.5 Nonparametric tests of group differences
7.6 Visualizing group differences
7.7 Summary
Part III Intermediate Methods
8 Regression
8.1 The many faces of regression
8.2 OLS regression
8.3 Regression diagnostics
8.4 Unusual observations
8.5 Corrective measures
8.6 Selecting the “best” regression model
8.7 Taking the analysis further
8.8 Summary
9 Analysis of variance
9.1 A crash course on terminology
9.2 Fitting ANOVA models
9.3 One-way ANOVA
9.4 One-way ANCOVA
9.5 Two-way factorial ANOVA
9.6 Repeated measures ANOVA
9.7 Multivariate analysis of variance (MANOVA)
9.8 ANOVA as regression
9.9 Summary
10 Power analysis
10.1 A quick review of hypothesis testing
10.2 Implementing power analysis with the pwr package
10.3 Creating power analysis plots
10.4 Other packages
10.5 Summary
11 Intermediate graphs
11.1 Scatter plots
11.2 Line charts
11.3 Correlograms
11.4 Mosaic plots
11.5 Summary
12 Resampling statistics and bootstrapping
12.1 Permutation tests
12.2 Permutation test with the coin package
12.3 Permutation tests with the lmPerm package
12.4 Additional comments on permutation tests
12.5 Bootstrapping
12.6 Bootstrapping with the boot package
12.7 Summary
Part IV Advanced Methods
13 Generalized linear models
13.1 Generalized linear models and the glm() function
13.2 Logistic regression
13.3 Poisson regression
13.4 Summary
14 Principal components and factor analysis
14.1 Principal components and factor analysis in R
14.2 Principal components
14.3 Exploratory factor analysis
14.4 Other latent variable models
14.5 Summary
15 Advanced methods for missing data
15.1 Steps in dealing with missing data
15.2 Identifying missing values
15.3 Exploring missing values patterns
15.4 Understanding the sources and impact of missing data
15.5 Rational approaches for dealing with incomplete data
15.6 Complete-case analysis (listwise deletion)
15.7 Multiple imputation
15.8 Other approaches to missing data
15.9 Summary
16 Advanced graphics
16.1 The four graphic systems in R
16.2 The lattice package
16.3 The ggplot2 package
16.4 Interactive graphs
16.5 Summary

afterword Into the rabbit hole
appendix A Graphic user interfaces
appendix B Customizing the startup environment
appendix C Exporting data from R
appendix D Creating publication-quality output
appendix E Matrix Algebra in R
appendix F Packages used in this book
appendix G Working with large datasets
appendix H Updating an R installation
index


Thursday, August 25, 2011

Forecasting time series using R

если Вы в Мельбурне, Австралия
это событие может заинтересовать

upg: Here are the main changes in The forecast package for R, version 3, plus a few earlier additions that Rob J Hyndman thought deserved a mention. >>>

Monday, May 2, 2011

Nets-Dats

Social Network Analysis Labs in R and SoNIA

McFarland, Daniel A., Solomon Messing, Michael Nowak and Sean J. Westwood.
To run the following labs install R (Linux, MacOS X or Windows) and execute the following command in R (this will download and install all needed packages and data):
source("http://sna.stanford.edu/setup.R")

Chapters

1. “Introductory Lab.” Nowak, Michael and Daniel A. McFarland. 2010.
2. “Methodological Beginnings – Basic Triadic and Cohesion Measures.” Nowak, Michael and Daniel A. McFarland. 2010.

3. “Clusters, Factions and Cores.” Nowak, Michael and Daniel A. McFarland.

4. “Centralities and Their Interrelation.” Sukumaran, Abhay,Michael Nowak and Daniel A. McFarland.

5. "Affiliation Data and Network Mobility." Messing, Solomon and Daniel A. McFarland. 2010.

6. "Structural Equivalences and Block-Modeling." Nowak, Michael, Solomon Messing, Sean J. Westwood and Daniel A. McFarland. 2010.

7. “Peer Influence and QAP Regression." Messing, Solomon, Sean J. Westwood and Daniel A. McFarland. 2010.
8. "Exponential-Family Random Graph Models.” Westwood, Sean J. and Daniel A. McFarland. 2010.
9. "Converting igraph to SoNIA with R." Westwood, Sean J. and Daniel A. McFarland. 2010.
10. "rSoNIA and Visualizing Social Network Dynamics." Bender-deMoll, Skye and Daniel A. McFarland. 2010.

Additional software

SoNIA is a Java-based package for visualizing dynamic or longitudinal "network" data. (This is a temporary download meant to fix SoNIA while a new release is under work)
Software required to run SoNIA:
Acknowledgements: Special thanks to Skye Bender-deMoll and James Moody. An earlier version of the introductory lab, the Exponential Random Graph Model lab, and rSoNIA lab were developed in collaboration with them. We have revised, extended and reorganized the content of those labs here.
This material is based upon work supported by the Office of the President at Stanford University and the National Science Foundation under Grants No. 0835614 and 0624134. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of Stanford University or the National Science Foundation.

Tuesday, March 22, 2011

скрадено из R камуны ЖЖ

Добавлю свои две копейки в сообщество.

Здесь лежат материалы по анализу динамики социальных сетей в R с помощью приложения RSiena.

там же есть обмен мнениями и доп.ссылки

Thursday, March 17, 2011

гугельный коммунизм

Групповой блог

С Blogger легко создать коллективный блог, позволяющий нескольким авторам участвовать в ведении единого блога. Вы можете выбрать, кто из членов команды будет иметь административные полномочия, а кто просто будет автором. Кроме того, свой блог можно сделать конфиденциальным и ограничить круг лиц, которые смогут его просматривать. Это позволит вам полностью контролировать блог.

Tuesday, March 15, 2011

автоматический подбор моделей

речь о коэффициентах модели, некоторые из которых не значимы, но значимость им, вообще говоря, и не требуется -- это же не проверка гипотез. Оказывается, R это делает автоматично:

A much more reliable guide to selecting terms in any model, including ARIMA models, is to use cross-validation or an approximation to it such as the AIC. The auto.arima()function from the forecast package in R uses the AIC by default and usually chooses a reasonably good model for forecasting. If users wish to experiment with other models, use the AIC for comparison not significance tests of the coefficients.

источник
AIC = Akaike’s Information Criterion

Saturday, March 12, 2011

миграция SPSS>R

подумалось: наверно неплохо было бы иметь переводчик SPSS команд в R, но, судя по всему, его на самом деле нет
почему?
нашёл статью по миграции с интересным, но мало понятным текстом:
Для OpenOffice.org существует другой замечательный пакет под названием odfWeave, который выполняет ту же саму задачу, что и Sweave(), но в документе OpenOffice. Вам даже не требуется копировать и вставлять таблицы или диаграммы: просто напишите код программы R в своем документе, пропустите его через R (да-да, R может так сделать) и на выходе вы получите новый документ ODF с таблицами и диаграммами именно в тех местах, где вы написали код.

Thursday, March 10, 2011

карты России

репост из ЖЖ _ab_

карта регионов России в R
Как известно, в R можно рисовать географические карты и наносить на них разную статистическую информацию. С картой мира, а также картой административных регионов некоторых стран (США, Франция, Италия, etc.), все просто -- они есть в пакетах maps и maptools в удобном формате.

С картой регионов России все сложнее -- ее в этих пакетах нет. В принципе, R умеет работать с ESRI shapefiles, хотя для этого требуется некоторая сноровка. Открытый слой границ субъектов РФ есть здесь. Однако проблема в том, что файл по ссылке содержит более 1500 строчек, т.е. многие регионы типа Архангельской области разбиты на мелкие кусочки. Это исключительно неудобно, когда нужно редактировать dbf-файл и объединять его с файлами, содержащими информацию на региональном уровне. К тому же, это слишком подробная карта -- часто нужен меньший уровень детализации границ регионов.

Соответственно, мои вопросы:

1) Известны ли кому-нибудь другие ESRI shapefiles c границами регионов России?
2) Если таких файлов в открытом доступе нет, возможно, есть люди, знакомые с GIS и R, которые могли бы перевести в удобный формат файл с Gis Lab, а еще лучше -- перевести его в формат R и выложить отдельным пакетом?

Wednesday, March 9, 2011

затык

R commander
при попытке прогнать логистическую регрессию получаю сообщение:
could not find function "is"
куда бежать?
насколько понимаю такой функции.нет ваще, есть is.нечто

Tuesday, March 1, 2011

RStudio

RStudio
RStudio was announced

The window contains a smart editor with code completion and tabbing, console, workspace with viewable objects, plotting panel with history, etc. And it runs on all major platforms (or over the web if you have a linux server handy).

It is freeware. Download and installation was a breeze. I think this is my new working environment for R!
забыл добавить источник
существенный коммент:
I have launched it and played a bit. Although I am not sure about the encoding (UTF-8?). Just wow!

Friday, February 25, 2011

ещё о логистической

Logistic regression can be used to predict a dependent variable on the basis of continuous and/or categorical independents and to determine the effect size of the independent variables on the dependent; to rank the relative importance of independents; to assess interaction effects; and to understand the impact of covariate control variables. The impact of predictor variables is usually explained in terms of odds ratios.

...  logistic regression does not assume linearity of relationship between the independent variables and the dependent, does not require normally distributed variables, does not assume homoscedasticity, and in general has less stringent requirements.
from menu:
Analyze - Regression - Binary Logistic
Analyze - Regression - Multinomial Logistic

Logit regression, discussed separately, is another related option in SPSS for using loglinear methods to analyze one or more dependents.




BINARY LOGISTIC REGRESSION: DEPENDENTS OUTCOME:
Binary variable is entered as a dependent Highest is predicted, lowest is reference
  The reference level cannot be changed.
MULTINOMIAL LOGISTIC REGRESSION: DEPENDENTS  
Binary or multinomial variable entered as dependent Highest is reference, all others compared to it by default.
  Click "Reference Category" button to override the default.     
в общем по ссылке ещё много и занудно

Thursday, February 24, 2011

любопытно (перепост)

Japan's Phillips Curve Looks Like Japan
Japan's Phillips Curvejapan
Source: Smith, G. Japan’s Phillips Curve Looks Like Japan. Gregor Smith. Queen’s Economics Department Working Paper No. 1083, Queen’s University