Area <- function(x,y) { A <- x*y print (paste(“The Area of the sides”,x,“X”,y," = “,A)) } Area(6,4)
Area.function <- function() { for(i in 1:10) z <- Area(i,i*2) }
Area.function()
Credit.csv <- read.csv(“C:/Users/Christian/Desktop/R/ITEC-620/Credit.csv”, header = TRUE) str(Credit.csv) head(Credit.csv) credit <- Credit.csv credit.1<- credit[1:5,1:5] credit.1
fit.rating <- lm(credit) summary(fit.rating)
credit.rating <- lm(X~Income+Limit+Cards+Married+Balance, data = credit) summary(credit.rating
data.frame(credit) class(credit\(Gender) class(credit\)Income) class(credit$Cards)
Factor is a yes or no (binary), numeric refers to decimal numbers and integers deal with whole numbers
income.vect$Income[1:6]
mean(income.vect\(Income) min(income.vect\)Income) max(income.vect\(Income) sd(income.vect\)Income) var(income.vect$Income)
income.stats <- c(mean(income.vect\(Income), max(income.vect\)Income), min(income.vect\(Income), sd(income.vect\)Income), var(income.vect$Income)) income.stats
income.stats2 <- c(“mean”, “max”, “min”, “sd”, “var”) names(income.stats) <- income.stats2 income.stats
1.05*income.vect$Income -> newmoney newmoney[1:6]
boxplot(income.vect$Income)
boxplot(data = income.vect,Income~Gender)
plot(data = income.vect, xlab = “Income”, ylab = “Credit Rating”, Income~Rating)
hist(data = credit, xlab = “Rating”, main = “Credit Rating Histogram”, credit$Rating)
qqnorm(credit\(Rating) qqline(credit\)Rating)
Yes I do think that it is somewhat normally distributed but I believe it also skews to the left of the median
ggplot(data = credit) + geom_histogram(aes(x = Rating))
ggplot(credit, aes(x=Income, y = Rating, group = Gender)) + geom_line() + facet_wrap(~ Gender)