Assignment lab 2
Assignment lab 2
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-")
> 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
summary(data1$GDP)
> summary(data1$GDP)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-37000 9350 15850 18072 29100 59900
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)
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%.