0% found this document useful (0 votes)
4 views4 pages

Assignment lab 2

The document contains data analysis on GDP and Fitch ratings using R programming. It includes calculations of maximum and minimum GDP values, a five-number summary, and a comparison of GDP distributions across different Fitch ratings, revealing trends in economic performance related to credit ratings. Additionally, it presents the distribution of country statuses, indicating a predominance of member countries.

Uploaded by

project4thyrtmsl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Assignment lab 2

The document contains data analysis on GDP and Fitch ratings using R programming. It includes calculations of maximum and minimum GDP values, a five-number summary, and a comparison of GDP distributions across different Fitch ratings, revealing trends in economic performance related to credit ratings. Additionally, it presents the distribution of country statuses, indicating a predominance of member countries.

Uploaded by

project4thyrtmsl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Akhil Srivastava –M24MSA070

Q.N

a<-max(data1$GDP)

b<-min(data1$GDP)

a-b
> max(data1$GDP)
[1] 59900
> min(data1$GDP)
[1] -37000
> a<-max(data1$GDP)
> b<-min(data1$GDP)
> a-b
[1] 96900
Q.L

table(data1$TD>0)

table(data1$TD>0)/sum(table(data1$TD))
> table(data1$TD>0)

FALSE TRUE
24 36
> table(data1$TD>0)/sum(table(data1$TD))

FALSE TRUE
0.4 0.6

Q.M

ratings <- c("BB+", "BBB+", "BB-", "BBB-", "BBB", "BB", "B", "B+", "B-")

non_matching_count <- nrow(data1) - nrow(data1[data1$FRating %in% ratings, ])

percentage <- (non_matching_count * 100) / 60


percentage

> ratings <- c("BB+", "BBB+", "BB-", "BBB-", "BBB", "BB", "B", "B+", "B-")
>
>
> non_matching_count <- nrow(data1) - nrow(data1[data1$FRating %in% ratings, ])
>
>
> percentage <- (non_matching_count * 100) / 60
> percentage
[1] 40

#2. Develop a five-number summary for the GDP.

summary(data1$GDP)
> summary(data1$GDP)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-37000 9350 15850 18072 29100 59900

#3.Compare the distribution GDP of Nations across different Fitch ratings.Write


your observation.

install.packages("dplyr")
library(dplyr)
fitch_gdp <- data1
dp<-data1 %>% group_by(Fitch.Rating) %>%
summarize(
Min = min(Per.Capita.GDP.($), na.rm = TRUE),
Q1 = quantile(Per.Capita.GDP.($), 0.25, na.rm = TRUE),
Median = median(Per.Capita.GDP.($), na.rm = TRUE),
Mean = mean(Per.Capita.GDP.($), na.rm = TRUE),
Q3 = quantile(Per.Capita.GDP.($), 0.75, na.rm = TRUE),
Max = max(Per.Capita.GDP.($), na.rm = TRUE),
Count = n()
)
print("GDP distribution across Fitch Ratings:")
print(fitch_gdp)

ggplot(data1, aes(x =Fitch.Rating, y =Per.Capita.GDP.($))) +


geom_boxplot() +
labs(
title = "Distribution of GDP across Fitch Ratings",
x = "Fitch Rating",
y = "Per Capita GDP ($)"
)+
theme_minimal()
 #inference:
Nations with lower Fitch ratings (e.g., BB, BB-) generally have lower GDP per capita.
The spread in GDP values for these ratings is also more variable ,with outliers being
evident.
 There appears to be a negative GDP per capita value for one or more nations,
possibly indicating data errors.
 For B and BBB-, there is a wider spread of GDP values, suggesting diversity in
economic performance for countries within these ratings.
 Countries with lower ratings exhibit more diverse economic performance, possibly
due to differing levels of development or external economic factors.
 The Fitch rating correlates with the economic prosperity of nations, with higher
ratings generally associated with wealthier economies.

#4.Construct a graphical plot representing the distribution of Status.

K<-table(data1$Status)
K
barplot(K)

Member Observer
54 6
> barplot(K)
Inference: We can clearly see that there is more member than observer and which clearly indicate the dominance of member in
Status column of the data.
So it is evident that 54 countries have member status out of 60 total countries that make it 90%.

You might also like