Storge changes
This commit is contained in:
1
lecture/Exercise/.Rhistory
Normal file
1
lecture/Exercise/.Rhistory
Normal file
@@ -0,0 +1 @@
|
||||
q()
|
||||
25
lecture/Exercise/exercise.r
Normal file
25
lecture/Exercise/exercise.r
Normal file
@@ -0,0 +1,25 @@
|
||||
# Setzen des Pfades und Einlesen der Daten
|
||||
library(httpgd)
|
||||
hgd(port = getOption("httpgd.port", 11111),
|
||||
token = getOption("httpgd.token", FALSE),)
|
||||
|
||||
setwd("/config/workspace/assistenz-r/lecture")
|
||||
Daten <- read.csv("Mietspiegel.csv",header=TRUE,sep=";",fill=TRUE)
|
||||
|
||||
Daten[,"bad"] <- as.factor(Daten[,"bad"])
|
||||
Daten[,"kueche"] <- as.factor(Daten[,"kueche"])
|
||||
Daten[,"lage"] <- as.factor(Daten[,"lage"])
|
||||
Daten[,"zh"] <- as.factor(Daten[,"zh"])
|
||||
|
||||
# Berechnung der linearen Regression
|
||||
|
||||
model <- lm( mieteqm ~ flaeche + bjahr + bad + kueche + lage + zh, data=Daten)
|
||||
|
||||
plot(model)
|
||||
|
||||
y <- Daten[,"mieteqm"]
|
||||
Prognosen <- model$fitted.values
|
||||
Prognosefehler <- mean( abs( y - Prognosen ) )
|
||||
Prognosefehler
|
||||
|
||||
Sys.sleep(10000)
|
||||
Reference in New Issue
Block a user