Dosen Pembimbing : Prof. Dr. Suhartono, M.Kom

Lembaga : Universitas Islam Negeri Maulana Malik Ibrahim Malang

Jurusan : Teknik Informatika

Fakultas : Sains dan Teknologi

library(mosaicCalc)
## Loading required package: mosaicCore
## Loading required package: Deriv
## Loading required package: Ryacas
## 
## Attaching package: 'Ryacas'
## The following object is masked from 'package:stats':
## 
##     integrate
## The following objects are masked from 'package:base':
## 
##     %*%, diag, diag<-, lower.tri, upper.tri
## Registered S3 method overwritten by 'mosaic':
##   method                           from   
##   fortify.SpatialPolygonsDataFrame ggplot2
## 
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
## 
##     D
library(mosaic)
## 
## The 'mosaic' package masks several functions from core packages in order to add 
## additional features.  The original behavior of these functions should not be affected by this.
## 
## Attaching package: 'mosaic'
## The following objects are masked from 'package:dplyr':
## 
##     count, do, tally
## The following object is masked from 'package:Matrix':
## 
##     mean
## The following object is masked from 'package:ggplot2':
## 
##     stat
## The following objects are masked from 'package:stats':
## 
##     binom.test, cor, cor.test, cov, fivenum, IQR, median, prop.test,
##     quantile, sd, t.test, var
## The following objects are masked from 'package:base':
## 
##     max, mean, min, prod, range, sample, sum
Utils <- read.csv("http://www.mosaic-web.org/go/datasets/utilities.csv")
gf_point(ccf ~ temp, data = Utils) %>%
  gf_labs(y = "Natural gas usage (ccf/month)", 
          x = "Average outdoor temperature (F)")

f <- fitModel(ccf ~ A * temp + B, data = Utils)
gf_point(ccf ~ temp, data = Utils) %>%
  slice_plot(f(temp) ~ temp)

f2 <- fitModel(
  ccf ~ A * temp + B + C *sqrt(temp),
  data = Utils)
gf_point(
  ccf ~ temp, data = Utils) %>%
  slice_plot(f2(temp) ~ temp)

Hondas <- read.csv("http://www.mosaic-web.org/go/datasets/used-hondas.csv")
head(Hondas)
##   Price Year Mileage Location Color Age
## 1 20746 2006   18394  St.Paul  Grey   1
## 2 19787 2007       8  St.Paul Black   0
## 3 17987 2005   39998  St.Paul  Grey   2
## 4 17588 2004   35882  St.Paul Black   3
## 5 16987 2004   25306  St.Paul  Grey   3
## 6 16987 2005   33399  St.Paul Black   2
carPrice3 <- fitModel(
  Price ~ A + B * Age + C * Mileage + D * Age * Mileage +
    E * Age^2 + F * Mileage^2 + G * Age^2 * Mileage + 
    H * Age * Mileage^2,
  data = Hondas)
gf_point(Mileage ~ Age, data = Hondas, fill = NA) %>%
contour_plot(
  carPrice3(Age=Age, Mileage=Mileage) ~ Age + Mileage)