アットウィキロゴ

TSA013

 ・参考 田中孝文[2008]第五章を改変

xdata <- read.table("fukyu.csv",sep=",",skip=1)
x <- ts(xdata,start=c(1961,1),frequency=1)
ac <- x[,2]
cr <- x[,3]
ttl <- "diffusion rate of Air Conditioner and Car in JPN"#「diffusion rate」で意味通じる不明
ts.plot(ac,cr,main=ttl,lty=c(1:2))
hanrei <- c("AirCndt","car")
legend(2000,50,legend=hanrei,lty=c(1:2),box.lty=0)

www23.atwiki.jp/waseda2bun_r 

#linerの場合…、
time1 <- seq(1,length(ac));time1
kaiki1 <- lm(ac~time1);summary(kaiki1);plot(kaiki1)

time2 <- seq(1,length(cr));time2
kaiki2 <- lm(cr~time2);summary(kaiki2);plot(kaiki2)

曲線の場合

#ロジ曲
#田中p80付近がうまくいかないためかなり改変
A = 100#最終的に100%普及すると仮定
x1 <- is.na(ac)
rate_ac <-ac[x1==FALSE]
z1 <- log((A-ac)/ac)
z1_dh <- is.na(z1)
Z1 <-  ac[z1_dh==FALSE]
time1 <- 1:length(Z1)
kaiki1 <- lm(Z1~time1)

 

 

 

 

最終更新:2010年10月23日 02:03