This set of exercises is about exploratory factor analysis. We shall use some basic features of psych package. For quick introduction to exploratory factor analysis and psych package, we recommend this short “how to” guide. You can download the dataset here. The data is fictitious. Answers to the exercises are available here. If you have […]

## Exploratory Factor Analysis – Solutions

Below are the solutions to these exercises on exploratory factor analysis. #################### # # # Exercise 1 # # # #################### install.packages(c("psych", "GPArotation")) library(psych) data <- read.file("efa.csv") describe(data) ## vars n mean sd median trimmed mad min max range skew kurtosis ## V1 1 649 4.79 0.47 5 4.89 0.00 3 5 2 -2.16 3.96 […]

## Experimental Design Exercises

In this set of exercises we shall follow the practice of conducting an experimental study. Researcher wants to see if there is any influence of working-out on body mass. Three groups of subjects with similar food and sport habits were included in the experiment. Each group was subjected to a different set of exercises. Body […]

## Experimental Design Solutions

Below are the solutions to these exercises on Experimental design exercises #################### # # # Exercise 1 # # # #################### data <- read.csv("experimental-design.csv") as.factor(data$group) -> data$group as.factor(data$age) -> data$age summary(data$initial_mass) ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 53.50 62.18 68.90 67.70 72.27 86.00 summary(data$final_mass) ## Min. 1st Qu. Median Mean 3rd […]

## Data Structures Exercises

There are 5 important basic data structures in R: vector, matrix, array, list and dataframe. They can be 1-dimensional (vector and list), 2-dimensional (matrix and data frame) or multidimensional (array). They also differ according to homogeneity of elements they can contain: while all elements contained in vector, matrix and array must be of the same […]

## Data Structures Solutions

Below are the solutions to these exercises on data structures. #################### # # # Exercise 1 # # # #################### v <- sample(-100:100, 10, replace=TRUE) #################### # # # Exercise 2 # # # #################### a <- array(seq(from = 26, length.out = 25, by = 2), c(5, 5)) s <- LETTERS[match("C", LETTERS):(match("C", LETTERS)+19)] #################### # […]

## Protected: Student’s Achievement Research Project – Exercises

There is no excerpt because this is a protected post.

## Protected: Student’s Achievement Research Project – Solutions

There is no excerpt because this is a protected post.

## String Manipulation – Exercises

In this set of exercises we will practice functions that enable us to manipulate strings.You can find more about string manipulation functions in Handling and Processing Strings in R e-book. Answers to the exercises are available here. If you have different solution, feel free to post it. Exercise 1 Load text from the file and […]

## String Manipulation – Solutions

Below are the solutions to these exercises on functions that are used to manipulate strings. #################### # # # Exercise 1 # # # #################### gambler <- readLines("http://www.r-exercises.com/wp-content/uploads/2016/11/gambler.txt") noquote(gambler) ## [1] At length I returned from two weeks leave of absence to find that my patrons had arrived three days ago in Roulettenberg. I received […]