Data Analytics II: Group Assignment

Verified

Added on  2023/04/20

|25
|2842
|93
AI Summary
This document is a group assignment for Data Analytics II. It covers topics such as data understanding, data preparation, prediction models, and problem conclusions. The assignment analyzes the leadership styles of Barack Obama and their impact on vote results.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Data Analytics II: Group Assignment
Name of the Student
Name of the University

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Table of Contents
2 Section 1: The Problem..........................................................................4
3 Section 2: Data Understanding..............................................................5
3.1 Tableau Visualisation:......................................................................5
3.2 R Visualisation and Aggregation Table:...........................................7
4 Section 3: Data Preparation...................................................................7
5 Section 4: Generate and Test Prediction Models...................................8
5.1 Prediction model related to Age distribution...................................8
6 Section 5: Problem Conclusions and Recommendations.....................10
7 Appendix:............................................................................................11
8 Trend or seasonality patterns in this US Births data...........................14
9 Forecasting US Birth............................................................................15
10 Comparison of seasonality pattern...................................................18
11 Recommendation..............................................................................19
12 Appendix...........................................................................................19
Document Page
PART I: OBAMA-
CLINTON CASE STUDY
Document Page
Section 1: The Problem
The 2008 US Presidential primaries evidenced candidates from the
Democratic Party, Barack Obama and Hillary Clinton in genuine dispute,
with various administration styles. Their methodologies reflected
contending hypotheses of 'administrative' and 'transformational' authority
styles. Hillary Clinton's methodology was visionary, yet she additionally
had confidence in controlling and guaranteeing that approaches were
actualized dependably. Barack Obama's methodology was by giving
vision, judgment and motivation. He trusted in appointing obligations and
achieving change by accord. Some administration specialists felt that a
micromanaging approach has only occasionally been powerful in realizing
change. Agreement building and helping individuals to accomplish shared
objectives was seen to be compelling in change the executives.
Obama's 2008 crusade was one of a kind and to some degree non-
replicable. Regardless of whether the enthusiastic inclusion Obama made
around himself will barely be accomplished by competitors in the next
years, there are numerous exercises to be gained from his battle that
can't be disregarded. After Kennedy, no political competitor could prevail
without a fruitful TV technique, by a similar token after Obama no
applicant will prevail without putting resources into online innovation. We
recognized five manners by which Obama changed political battles and
five advancements that each future competitor should remember. The
primary exercise respects Obama's focusing on systems, the second is
tied in with marking. The third area will inspect the accomplishment of
Obama's online correspondence. The fourth exercises is tied in with fund-
raising utilizing new Medias, the fifth and last exercise is tied in with
running a development not a battle.
The case starts exchange on various authority styles and their effect on
change the executives. The objectives of this study was:
To analyse the leadership styles of Barack Obama.
To understand the impact of leadership style on vote results.

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Section 2: Data Understanding
Here, the data set contains series of variables related to 2008 US election.
The data were gathered post election and related to both Clinton and
Obama. However, all variables were not included in the analysis. To
understand the leadership style of Barak Obama as well as its impact on
voting results, data related to ethnicity, that is, white, black, Asian,
American Indian, Hawaiian, and Hispanic variables were taken into
considered as one set of variable. On the other hand, data related age
specification and educational qualifications were also taken into account.
Both tableau visualisation as well as R modelling have been used to
understand the nature and characteristic of data set.
Tableau Visualisation:
The first visualisation is all about plotting number of votes Barak Obama
received in different states. The colour combination has shown the volume
of votes he received.
Figure 1: States vs Votes [Obama]
The below dashboard is a combination of scatter plots of different
variable. Taken for example, if the number of votes and Ethnicity is
considered here, then it can be seen that there is a positive association
between number of votes Barak Obama has received and Asian people,
Black people, Hawaiian people and Hispanic people. On the other hand,
Document Page
American Indian, and white people has negative association with number
of votes he received.
Similarly, while educational qualifications are taken into consideration,
then it can be found that both High school as well as bachelors have
supported positively. Finally, if the age group is taken into consideration,
then it can be said that above 65 age group people has shown negative
attitude in terms of giving votes to Barak Obama.
figure 2: Correlations
Document Page
Figure 3: Box Plot
It seems, the leadership style of Barak Obama positively influenced
young, non white people mostly and resulted a huge figure in terms of
getting votes.
R Visualisation and Aggregation Table:
Regio
n
Clinton_
total
Obama_
total
Total_
Vote
South 3191621 3773425 758085
9
West 3338179 2988643 666908
6
North
east
2666392 2050694 490813
5
Midw
est
1180191 1918637 318633
4
Table 1: Voting Details with respect to Region
ElectionT
ype
Clinton_t
otal
Obama_t
otal
Total_V
ote
Primary 10257607 10497560 2198224
1
Caucuses 118776 233839 362173
Table 2: Voting Details with respect to Election Type
Obama
AgeBelow35 0.09033594

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Age35to65 0.0244918
Age65andAbov
e -0.14266704
White -0.12931663
Black 0.07053961
Asian 0.43500642
AmericanIndian -0.03471812
Hawaiian 0.17710619
Hispanic 0.17864521
HighSchool 0.09687217
Bachelors 0.26673084
Table 3: Correlation Table
Section 3: Data Preparation
Considering the above mentioned result, the study has subdivided into
three segments, number of votes Obama has received with respect to
ethnicity, age group and educational qualification. This has been
considered in attempts to understand how the leadership style of Obama
has influenced people with different ethnicity, different age group and
qualifications. As a next step, 80% of the data has been considered as
training data and rest 20% data has been considered as test data for
prediction purpose. The detailed predicted model after classifying into
training and test data has been performed with the help of R statistical
software.
Document Page
Section 4: Generate and Test Prediction
Models
Prediction model related to Age distribution
Figure 4: Obama vs Age Distribution
Document Page
Figure 5: Obama vs Ethnicity
Figure 6: Obama vs Educational Qualifications

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Section 5: Problem Conclusions and
Recommendations
On the basis of analysis done in the above section, it can be concluded
that prior to the election, President Barack Obama pulled in the
consideration of American's and outsiders alike with an apparently alluring
nature. However, post election, it has become apparent that an appealing
pioneer has an uncanny capacity to attract others to his side and move
them to achieve a reason greater than themselves. A charming
methodology is transformational in the event that it summons a perpetual
change in the general population who grasp the pioneer's vision. Amid his
first term, President Obama charmed probably some to his vision by
appearing potential to have a tremendous effect in both local and outside
issues. In his second term, he appeared to be all the more detached and
showed less capacity to attract others to his motivation. Some even feel
that he has not satisfied full desires.
Document Page
Appendix:
library(dplyr)
data<-read.csv("Obama.csv")
x<-na.omit(data)
Voting_details<- x %>%
group_by(Region) %>%
summarise(Clinton_total=sum(Clinton),Obama_total=sum(Obama),Total_
Vote=sum(TotalVote)) %>%
arrange(desc(Total_Vote))
Voting_details
Voting_details1<- x %>%
group_by(ElectionType) %>%
summarise(Clinton_total=sum(Clinton),Obama_total=sum(Obama),Total_
Vote=sum(TotalVote)) %>%
arrange(desc(Total_Vote))
Voting_details1
cor(x[,9:24])
set.seed(100)
trainingRowIndex <- sample(1:nrow(x), 0.8*nrow(x)) # row indices for
training data
trainingData <- x[trainingRowIndex, ] # model training data
testData <- x[-trainingRowIndex, ] # test data
lmMod <- lm(Obama ~ AgeBelow35 + Age35to65 + Age65andAbove,
data=trainingData) # build the model
distPred <- predict(lmMod, testData) # predict distance
summary (lmMod) # model summary
lmMod1 <- lm(Obama ~ White + Black + Asian + AmericanIndian +
Hawaiian + Hispanic, data=trainingData) # build the model
Document Page
distPred <- predict(lmMod1, testData) # predict distance
summary (lmMod1) # model summary
lmMod2 <- lm(Obama ~ HighSchool + Bachelors, data=trainingData) #
build the model
distPred <- predict(lmMod2, testData) # predict distance
summary (lmMod2) # model summary

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
PART II: NICU CASE
STUDY
Document Page
Trend or seasonality patterns in this US
Births data
The quantity of births differs especially via season, yet the reasons for this
variety are not surely knew. Contrasts in the level of regularity between
socio-statistic gatherings (characterized by maternal age, conjugal status,
training and birth request) were analyzed by investigation of bends, by
looking at coefficients of varieties of month to month quantities of births,
and by ascertaining the proportions of the quantity of births in the 3 top
months (March to May) to the quantity of births in the 3 most minimal
months (October to December). We discovered expansive contrasts in the
extent of the occasional variety in births by socio-statistic factors. The
occasional variety was exceptionally articulated in moms who were 25– 34
years of age, had advanced education, were hitched, and were pregnant
with their second or third kid. On the other hand, birth regularity was
powerless in moms who were ≤19 years or ≥35 years old, unmarried, had
low training, and expected their first or fourth or higher request birth. In a
multivariate model, each of the four socio-statistic factors contributed
fundamentally to occasional variety. These outcomes recommend that the
regularity of births is, in any event in this populace, firmly impacted by
socio-statistic factors.
Figure 7: US Birth Rates Seasonality
Document Page
AAN trend model
Figure 8: ANN Model

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
AAA trend model
Figure 9: AAA Model
Forecasting US Birth
Document Page
Figure 10: Forecasting using ANN
Document Page

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Figure 11: Forecasting using AAA
Comparison of seasonality pattern
Anticipating in R depends on a built up suite of strategies for time
arrangement forecast called exponential smoothing. Throughout the years
numerous strategies have been created for the examination of time
arrangement, contingent upon whether the information is emphatically
occasional or has no regularity, how much clamor there is in the
information, and whether the information contains "amazements" or
sporadic pinnacles. The exponential smoothing strategy has a decent
reputation in both scholarly world and business, and has the favorable
position that it stifles commotion, or undesirable variety that can mutilate
the model, while effectively catching patterns.
In R, we gave two forms of exponential smoothing, one for occasional
information (ETS AAA), and one for non-regular information (ETS AAN). R
utilizes the fitting model naturally when you begin an estimate for your
line graph, in light of an examination of the verifiable information.
Document Page
The recipes are not yield but rather the general strategy is broadly
acknowledged in the scholarly community, and we've depicted the
subtleties here:
Regular calculation (ETS AAA)
The regular calculation (ETS AAA) models the time arrangement utilizing a
condition that represents added substance blunder, added substance
pattern, and added substance regularity. This calculation is likewise
famously known as the Holt-Winters calculation, after the scientists who
portrayed the qualities of the model. The Holt-Winters technique is
generally utilized, for instance, in foreseeing and arranging request in
organizations.
For estimating in R outlines, we made a few upgrades to the Holt Winters
calculation to make it increasingly impervious to commotion in the
information. In particular, we have made the accompanying changes:
Utilization of approval window for ideal parameter choice
The established Holt-Winters technique finds the ideal smoothing
parameters by limiting the mean whole of squares of blunders for
forecasts in the preparation window, taking a gander at expectations that
are one-advance ahead. Nonetheless, the blunders you get from looking
only one stage ahead probably won't be illustrative of the mistakes you
get when you need a more extended skyline conjecture. Along these lines,
to enhance long-run estimating blunder, we presented an approval
window, which contains the last couple of purposes of the preparation
window. Inside this approval window, we don't modify the state at every
single step, yet rather, figure the entirety of squares of expectation
blunders for the window in general. This has the impact of hosing variety
and protecting pattern over the approval window.
Document Page
State vector redress toward the finish of preparing window when
information is loud.
The first calculation (ETS AAA) is a state-space-based estimating strategy.
Basically, gauges are weighted midpoints of past perceptions, with
ongoing perceptions given more weight. A state vector is determined all
through the preparation window and is utilized to register the preparation
fit. Be that as it may, when the ideal smoothing parameters in the model
are moderately high, the model can wind up touchy to anomalies. In the
event that the exceptions show up in the last piece of the preparation
window, this affectability is expanded, on the grounds that the latest
perceptions are weighted all the more vigorously. Basically, an exception
in the wrong spot can misshape the model, pulling the preparation fit
towards itself. Subsequently, gauges can look peculiar – for instance, the
estimate may move in a pattern inverse to that in the info time
arrangement.
To stay away from such contortions, we naturally track varieties in the
preparation state. When we distinguish huge varieties, we change the
pattern in the time window to all the more intently coordinate the general
pattern of the time arrangement and modify the estimate esteems as
needs be.
Non-occasional calculation (ETS AAN)
The non-occasional calculation (ETS AAN) utilizes a less complex condition
to display the time arrangement, which incorporates just a term for added
substance pattern and added substance mistake, and does not think
about regularity by any means. We accept information esteems increment
or diminishing somehow or another that can be portrayed by an equation,
yet that the expansion or decline isn't repeating.

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Comparing both model, it can be said that AAA is the best fit over here.
Recommendation
The strategy of expanding number of beds will be considered as the
positive aspect as supported by the model mentioned below:
Document Page
Appendix
NICUA<-read.csv("NICUA.csv")
Seasonality<-
ts(NICUA$Admits,start=c(2007,7),end=c(2013,2),frequency=12)
Seasonality
Seasonality_train <- window(Seasonality, start = c(2007,7), end =
c(2013,1), frequency = 12)
Seasonality_test <- window(Seasonality, start = c(2012,2), end =
c(2012,3), frequency = 12)
install.packages("forecast")
library(forecast)
fit1 <- ets(Seasonality_train, model = "ANN")
Document Page
plot(fit1)
fit1_forecast <- forecast(fit1, h = 2)
fit1_forecast
plot(fit1_forecast)
fit2 <- ets(Seasonality_train, model = "AAA")
plot(fit2)
fit2_forecast <- forecast(fit2, h = 2)
fit2_forecast
plot(fit2_forecast)
fit3<-ets(Seasonality)
fit3_forecast<-forecast(fit3,h=2)
par(mfrow = c(1,3))
plot(fit1_forecast, main="Simple exponential model")
plot(fit2_forecast, main="Seasonal trend model")
plot(fit3_forecast, main="Best model (lowest AIC)")
summary(fit1)
summary(fit2)
x<-na.omit(NICUA)
lmMod<-lm(ALOS~Admits + Year + Month, data=x)
summary(lmMod)
1 out of 25
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]