This site provides support for doing data analysis with the R program using the functions in the package lessR, as documented by the accompanying text.
The new look of data analysis output.
An R program overview of lessR input.
Both R and lessR are free and open source, and run identically on Macintosh, Windows and Linux/Unix computers.
Note: The .Rprofile file shown in the video must first be created, such as from RStudio with:
File --> New File -> Text File
Any features added to lessR since August, 2013 are not presented in the book. Enter Help(lessR), then click on Package NEWS to see the full set of additions and bug fixes.
r <- reg(Y ~ X)To see the names of all the segments, enter
names(r)referring to the name of the output object, here r. Then the segments can be listed separately, such as
r$out_estimatesIn addition, the
knitr.fileoption generates a specified knitr file that can be run with additional interpretative text. This option is currently available for Regression, Histogram (and BoxPlot, Density and ScatterPlot) and cfa functions.
mydata <- rd("Reading", format="lessR") reg(Reading ~ Verbal + Absent + Income, knitr.file="reg")Process this markdown file, such as in RStudio with the knit button. This html is output from the knit procedure.
1. The text files listed below for download can also be accessed directly from the web from within R with the following Read statement.
> mydata <- Read("http://lessRstats.com/data/name")
Replace name with the specific name of the file to access. Most of the text files are in csv format, for Comma Separated Values. Other text files are in the fwd format, for Fixed WiDth, in which the data values for a variable all occupy the same columns.
2. The SPSS versions of the data files are provided for SPSS users who can compare R/lessR with SPSS. The purpose is to show that data analysis with the lessR functions within the standard R environment is no more difficult that using SPSS in its GUI environment. And, by comparison, the R environment is much faster and more responsive, and, of course, free.
3. Files that are contained within lessR have already been downloaded when the lessR package was installed. To access any of these files from within R, use the Read function with the format option set to "lessR". For example, read a data table from the specified file into the data frame called mydata with the following R statement.
> mydata <- Read("name", format="lessR")
Replace name with the specific name of the file to download. The data files that are part of lessR are BodyMeas, Cars93, Employee, Learn, Mach4 and Reading. The Employee and Mach4 data tables already have the variable labels included.
|1.6.5||employee.csv||employee.sav||Employee data table|
|1.6.6||Mach4.fwd||Mach4.sav||Responses to the 20-item Mach IV scale|
|2.2.1||employee.csv||employee.sav||Employee data table|
|2.4||employee_lbl.csv||Variable labels for employee data table, csv format|
|2.4||employee_lbl.xlsx||Variable labels for employee data table, Excel format|
|2.6||HtWtEg.fwd||Fixed width text data file for Exercise 2-3|
|2.6||Mach4Plus.fwd||Fixed width text data file for Exercise 2-4. All items already reversed scored.|
|3.7.1||Emp1a.csv||First file to horizontal merge|
|3.7.1||Emp1b.csv||Second file to horizontal merge|
|3.7.2||Emp2a.csv||First file to vertical merge|
|3.7.2||Emp2b.csv||Second file to vertical merge|
|3.8||Cars93.csv||Data from 1993 cars for Exercise 3-2 to 5|
|4.2||employee.csv||employee.sav||Employee data table|
|4.5||psych.csv||Text data file for Exercises 4-1, 4-2 and 4-3|
|5.6.1||Ratings.csv||Time series data of student ratings of a professor|
|5.6.2||WorldPopulation.csv||World population data over time|
|5.7||Cars93.csv||Data from 1993 cars for Exercise 5-1|
|5.7||Mach4.fwd||Mach4.sav||Responses to the 20-item Mach IV scale, Exercise 5-2|
|6.2.1||Mach4.fwd||Mach4.sav||Responses to the 20-item Mach IV scale, Exercise 5-2|
|6.3.4||Learn.csv||Data for massed vs. distributed practice experiment|
|6.4.1||WeightLoss.csv||Weight loss data|
|6.5||employee.csv||employee.sav||Employee data table for Exercise 6-1|
|6.5||Cars93.csv||Data from 1993 cars for Exercise 6-2|
|7.2.1||anova_1way.csv||One-way analysis of variance, unstacked data that needs to be reshaped first|
|7.2.1||anova_1way_stacked.csv||One-way analysis of variance, stacked data ready for analysis|
|7.3.1||anova_rb.csv||Randomized block analysis of variance|
|7.4.1||anova_2way.csv||Two-way analysis of variance|
|7.5.1||anova_rbf.csv||Randomized block factorial analysis of variance|
|7.5.2||anova_sp.csv||Split-plot factorial analysis of variance|
|7.6||WeightLoss4.csv||Weight loss data for Exercise 7-2|
|7.6||Anxiety.csv||Anxiety data for Excercise 7-3|
|8.2.1||employee.csv||employee.sav||Employee data table|
|8.2.5||Mach4.fwd||Mach4.sav||Responses to the 20-item Mach IV scale|
|8.5||Cars93.csv||Data from 1993 cars for Exercise 8-1|
|9.2.2||employee.csv||employee.sav||Employee data table|
|9.6||BodyMeas.csv||Body measurements for Exercises 9-1 and 2|
|9.6||Cars93.csv||Data from 1993 cars for Exercises 9-3|
|10.5||BodyMeas.csv||Body measurements for Exercise 10-1|
|10.5||Cars93.csv||Data from 1993 cars for Exercise 10-2|
|11.3.2||Mach4.fwd||Mach4.sav||Responses to the 20-item Mach IV scale|
|11.5.2||MIMMperfect.cor||Population correlation matrix for the specified measurement model|
|11.7||Mach4Plus.fwd||Fixed width text data file for Exercises 11-1 and 2. All items already reversed scored.|