time series 时间序列 | fractional factorial design 部分要因试验设计
作业:
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.
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 部分要因试验设计的更多相关文章
- R绘图基础
一,布局 R绘图所占的区域,被分成两大部分,一是外围边距,一是绘图区域. 外围边距可使用par()函数中的oma来进行设置.比如oma=c(4,3,2,1),就是指外围边距分别为下边距:4行,左边距3 ...
- R Customizing graphics
Customizing graphics GraphicsLaTeXLattice (Treillis) plots In this chapter (it tends to be overly co ...
- Pandas 之 DataFrame 常用操作
import numpy as np import pandas as pd This section will walk you(引导你) through the fundamental(基本的) ...
- EEG: electrode positions & Broadmann atlas
Source: http://www.brainm.com/software/pubs/dg/BA_10-20_ROI_Talairach/nearesteeg.htm Area LEFT RIG ...
- SPM paired t-test步骤
首先感谢大神空里流霜耐心的讲解,这篇笔记内容主要是整理他的谆谆教导,虽然他也看不到>< 所有数据都要经过平滑. Paired t-test虽然在2nd-level analysis中,但是 ...
- SPM12manual,统计部分(8-10)笔记
fMRI model specifictaion GLM based 包括以下步骤:①明确GLM设计矩阵:②用经典或贝叶斯方法估计GLM参数:③利用对比向量检查结果,生成统计参数图(SPMs)以及后验 ...
- Chapter 6 — Improving ASP.NET Performance
https://msdn.microsoft.com/en-us/library/ff647787.aspx Retired Content This content is outdated and ...
- Prometheus监控⼊⻔简介
文档目录: • prometheus是什么?• prometheus能为我们带来些什么• prometheus对于运维的要求• prometheus多图效果展示 1) Prometheus是什么pro ...
- 极简 R 包建立方法--转载
https://cosx.org/2013/11/building-r-packages-easily/ 最近想试一下捣腾一个 R 包出来,故参考了一些教程.现在看到的最好的就是谢益辉大大之前写过的开 ...
随机推荐
- Git使用和Vue项目
1.创建git排除文件,.gitignore 2.READEME.md 和 LICENSE开源协议 git init 创建仓库 , git status 查看文件状态 红色文件表示未提交. git ...
- 如何提高单片机C语言代码效率
代码效率包括两个方面内容:代码的大小和代码执行速度.如果代码精简和执行速度快,我们就说这个代码效率高.一般情况下,代码精简了速度也相应提上来了.单片机的ROM和RAM的空间都很有限,当您编程时遇到单片 ...
- C#WFM关于PICBOX 再DIP界面放大125%后,图片显示不完整
外观哪里选中Zoom,就好
- polyfillJS生成promise对象
https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js
- 2018-2019-2 网络对抗技术 20165316 Exp4 恶意代码分析
2018-2019-2 网络对抗技术 20165316 Exp4 恶意代码分析 一.原理与实践说明 1.实践目标 监控你自己系统的运行状态,看有没有可疑的程序在运行. 分析一个恶意软件,就分析Exp2 ...
- 初学javascript《一》break和continue的标签问题
<script>var iNum = 0;outermost:for (var i=0; i<3; i++) { for (var j=0; j<3; j++) { ...
- IP通信基础学习第八周
安装完华三模拟器,拖多台设备到工作区,全部启动及配置,建立好拓扑图,之后启动命令行终端. 配置登录用户,口令的指令有: <H3C> //用户直行 ...
- Java RSA 公钥加密私钥解密
package com.lee.utils; import java.io.DataInputStream; import java.io.File; import java.io.FileInput ...
- 系统开机时提示BOOTMGR is compressed
问题描述: 开机时提示 BOOTMGR is compressed Press Ctrl+Alt+Del to restart 操作方法: 1.插入带有U盘启动的U盘2.进入winpe系统后,打开“ ...
- Pandas截取列部分字符,并据此修改另一列的数据
#截取'股票代码'第一个字符 df['首字符'] = df['股票代码'].str[0:1] ' # 根据'首字符'列的值,修改'市场'的值. 1表示上海 截取字符串的部分字符: date=today ...