作业:

1) A plot of data from a time series, which shows a cyclical pattern – please show a time series plot and identify the length of the major cycle.

2) Data from a full factorial or fractional factorial experiment with at least 2 factors – please identify the factors and the dependent variable. It is sufficient to provide me with a small part of the dataset (e.g. 10 records), if the dataset is large.

slides for FFD

kings <- scan("http://robjhyndman.com/tsdldata/misc/kings.dat",skip=3)
kings
kingstimeseries <- ts(kings)
kingstimeseries
# An example is a data set of the number of births per month in New York city, from January 1946 to December 1959
births <- scan("http://robjhyndman.com/tsdldata/data/nybirths.dat")
birthstimeseries <- ts(births, frequency=12, start=c(1946,1))
birthstimeseries
#
souvenir <- scan("http://robjhyndman.com/tsdldata/data/fancy.dat")
souvenirtimeseries <- ts(souvenir, frequency=12, start=c(1987,1))
souvenirtimeseries
#
plot.ts(kingstimeseries)
#
plot.ts(birthstimeseries)
#
plot.ts(souvenirtimeseries)
#
logsouvenirtimeseries <- log(souvenirtimeseries)
plot.ts(logsouvenirtimeseries)
#
library("TTR")
birthstimeseriescomponents <- decompose(birthstimeseries)
birthstimeseriescomponents$seasonal
# get the estimated values of the seasonal component
plot(birthstimeseriescomponents)
#
birthstimeseriescomponents <- decompose(birthstimeseries)
birthstimeseriesseasonallyadjusted <- birthstimeseries - birthstimeseriescomponents$seasonal
plot(birthstimeseriesseasonallyadjusted)

  

#tell where the data come from
datafilename="http://personality-project.org/R/datasets/R.appendix1.data"
#read the data
data.ex1=read.table(datafilename,header=T)
#do the analysis
aov.ex1 = aov(Alertness~Dosage,data=data.ex1)
#show the table
summary(aov.ex1) # 2-way
datafilename="http://personality-project.org/r/datasets/R.appendix2.data"
#read the data
data.ex2=read.table(datafilename,header=T)
#show the data
data.ex2
#do the analysis
aov.ex2 = aov(Alertness~Gender*Dosage,data=data.ex2)
#show the summary table
summary(aov.ex2)

后面贴答案  

time series 时间序列 | fractional factorial design 部分要因试验设计的更多相关文章

  1. R绘图基础

    一,布局 R绘图所占的区域,被分成两大部分,一是外围边距,一是绘图区域. 外围边距可使用par()函数中的oma来进行设置.比如oma=c(4,3,2,1),就是指外围边距分别为下边距:4行,左边距3 ...

  2. R Customizing graphics

    Customizing graphics GraphicsLaTeXLattice (Treillis) plots In this chapter (it tends to be overly co ...

  3. Pandas 之 DataFrame 常用操作

    import numpy as np import pandas as pd This section will walk you(引导你) through the fundamental(基本的) ...

  4. EEG: electrode positions & Broadmann atlas

    Source: http://www.brainm.com/software/pubs/dg/BA_10-20_ROI_Talairach/nearesteeg.htm   Area LEFT RIG ...

  5. SPM paired t-test步骤

    首先感谢大神空里流霜耐心的讲解,这篇笔记内容主要是整理他的谆谆教导,虽然他也看不到>< 所有数据都要经过平滑. Paired t-test虽然在2nd-level analysis中,但是 ...

  6. SPM12manual,统计部分(8-10)笔记

    fMRI model specifictaion GLM based 包括以下步骤:①明确GLM设计矩阵:②用经典或贝叶斯方法估计GLM参数:③利用对比向量检查结果,生成统计参数图(SPMs)以及后验 ...

  7. Chapter 6 — Improving ASP.NET Performance

    https://msdn.microsoft.com/en-us/library/ff647787.aspx Retired Content This content is outdated and ...

  8. Prometheus监控⼊⻔简介

    文档目录: • prometheus是什么?• prometheus能为我们带来些什么• prometheus对于运维的要求• prometheus多图效果展示 1) Prometheus是什么pro ...

  9. 极简 R 包建立方法--转载

    https://cosx.org/2013/11/building-r-packages-easily/ 最近想试一下捣腾一个 R 包出来,故参考了一些教程.现在看到的最好的就是谢益辉大大之前写过的开 ...

随机推荐

  1. git使用手册整理

    -------------------20181217------------------- git使用:在gitbash 下初始化用户: $ git config --global user.nam ...

  2. 简单的Json数据

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <hea ...

  3. codeforces-3

    C Game"23" #include<iostream> using namespace std; int main() { long long n,m; long ...

  4. logback 按时间和大小生成日志不生效的问题

    服务器要记录所有的日志,这些日志输入到一个文件中太大了,就需要按大小和时间还分割,比如每小时产生一个文件或当文件大小大于200MB的时候生成一个文件. 第一版这样版本,但是服务器启动之后没有生成日志文 ...

  5. go basic

    go time and rand: package main import ( "fmt" "math/rand" "time" ) fun ...

  6. 关于Aspose.Words插入表格单元格的高度问题的解决

    最近在工作中遇到客户要将PDF打印的文档插入的表格行高缩小.为解决这个问题,我百度了好长时间,让没有直接来说明这个问题的,我不清楚是我遇到的问题太low了,各位大神不屑一顾.终于我在几个家之所长,把问 ...

  7. class多态

    多态代码实现: class Animal(object): def __init__(self, name): # Constructor of the class self.name = name ...

  8. 记录ok6410 jlink 命令行调试uboot

    1\启动ok6410 进入uboot命令行 2\启动JLinkGDBServer -device ARM11 3\arm-none-eabi-gdb u-boot 初始化脚本 # Connect to ...

  9. httplib和urllib2常用方法

    都是几年前用过的,现在翻出来记录一下. import httplib import urllib2 import socket ##---------------------------------- ...

  10. springMVC注解总结

    由于BookController类加了value="/book"的@RequestMapping的注解,所以相关路径都要加上"/book",即请求的url分别为 ...