In this set of exercises you will be presented with real-life problems in marketing. Your task will be to choose appropriate nonparametric statistical technique and solve the problem using appropriate R functions. Answers to the exercises are available here. Exercise 1 A company wants to learn if sales income is equaly distributed among the stores. […]

## Nonparametric Tests Solutions

Below are the solutions to these exercises on nonparametric tests. #################### # # # Exercise 1 # # # #################### # Chi-square goodness of fit # H0: f1=f2=f3=f4=f5=f6=f7=f8 # H1: f1!=f2 chisq.test(c(102, 300, 102, 100, 205, 105, 71, 92)) ## ## Chi-squared test for given probabilities ## ## data: c(102, 300, 102, 100, 205, 105, […]

## Network Analysis Part 3 Exercises

This is the third set of exercises on networks in which we practice the functions for graph structure, using package igraph. The first and second part are available here: Part 1 Part 2 If you don’t have package already installed, install it using the following code: install.packages(“igraph”) and load it into the session using the […]

## Network Analysis Part 3 Solutions

Below are the solutions to these exercises on analysing networks. #################### # # # Exercise 1 # # # #################### d <- read.csv("http://www.r-exercises.com/wp-content/uploads/2016/10/sociogram-employees-un.csv", header=FALSE) g <- graph.adjacency(as.matrix(d), mode="undirected") V(g)$name <- LETTERS[1:NCOL(d)] V(g)$color <- "orange" V(g)$shape <- "square" E(g)$color <- "blue" E(g)$arrow.size <- 0.2 plot(g) #################### # # # Exercise 2 # # # #################### largest_cliques(g) […]

## Network Analysis Part 2 Exercises

In this set of exercises we shall practice the functions for network statistics, using package igraph.If you don’t have package already installed, install it using the following code: install.packages(“igraph”) and load it into the session using the following code: library(“igraph”) before proceeding. You can find more info about the package and graphs in general here […]

## Network Analysis Part 2 Solutions

Below are the solutions to these exercises, Network Analysis Part 2. #################### # # # Exercise 1 # # # #################### d <- read.csv("sociogram-employees-un.csv", header=FALSE) g <- graph.adjacency(as.matrix(d), mode="directed") V(g)$name <- LETTERS[1:NCOL(d)] V(g)$color <- "yellow" V(g)$shape <- "sphere" E(g)$color <- "gray" E(g)$arrow.size <- 0.2 #################### # # # Exercise 2 # # # #################### plot(g) […]

## Network Analysis Part 1 Exercises

In this set of exercises we shall create an empty graph and practice the functions for basic manipulation with vertices and edges, using the package igraph. If you don’t have the package already installed, install it using the following code: install.packages(“igraph”) and load it into the session using the following code: library(“igraph”) before proceeding. You […]

## Network Analysis Part 1 Solutions

Below are the solutions to these exercises on analysing networks. #################### # # # Exercise 1 # # # #################### g <- make_empty_graph(n=5, directed=TRUE) V(g)$color = "yellow" V(g)$shape = "sphere" #################### # # # Exercise 2 # # # #################### g <- add.edges(g, c(1,2, 1,3, 2,4, 3,4, 4,5)) #################### # # # Exercise 3 # […]

## Fundamental and Technical Analysis of Shares Exercises

In this set of exercises we shall explore possibilities for fundamental and technical analysis of stocks offered by the quantmod package. If you don’t have the package already installed, install it using the following code: install.packages(“quantmod”) and load it into the session using the following code: library(“quantmod”) before proceeding. Answers to the exercises are available […]

## Fundamental and Technical Analysis of Shares Solutions

Below are the solutions to these exercises on Fundamental and Technical analysis of shares exercises. #################### # # # Exercise 1 # # # #################### # rata fb.p <- getSymbols("FB", env=NULL) #################### # # # Exercise 2 # # # #################### Cl(to.monthly(fb.p["2015::2015-12-31"])) ## Warning: timezone of object (UTC) is different than current timezone (). ## […]