[Returnanalytics-commits] r2760 - in pkg/PerformanceAnalytics/sandbox/Shubhankit/Week6-7: Code/Tests Vignette
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Aug 10 13:32:01 CEST 2013
Author: shubhanm
Date: 2013-08-10 13:32:00 +0200 (Sat, 10 Aug 2013)
New Revision: 2760
Added:
pkg/PerformanceAnalytics/sandbox/Shubhankit/Week6-7/Code/Tests/Tests.R
pkg/PerformanceAnalytics/sandbox/Shubhankit/Week6-7/Vignette/Test_Report.Rnw
pkg/PerformanceAnalytics/sandbox/Shubhankit/Week6-7/Vignette/Test_Report.pdf
Log:
Week 6-7 : Tests for comparison of HAC functions for comparative matlab functions status: completing
Added: pkg/PerformanceAnalytics/sandbox/Shubhankit/Week6-7/Code/Tests/Tests.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/Week6-7/Code/Tests/Tests.R (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/Week6-7/Code/Tests/Tests.R 2013-08-10 11:32:00 UTC (rev 2760)
@@ -0,0 +1,21 @@
+fpe <- read.table("http://data.princeton.edu/wws509/datasets/effort.dat")
+attach(fpe)
+lmfit = lm( change ~ setting + effort )
+sandwich(lmfit)
+Fr <- c(68,42,42,30, 37,52,24,43,
+ 66,50,33,23, 47,55,23,47,
+ 63,53,29,27, 57,49,19,29)
+
+Temp <- gl(2, 2, 24, labels = c("Low", "High"))
+Soft <- gl(3, 8, 24, labels = c("Hard","Medium","Soft"))
+M.user <- gl(2, 4, 24, labels = c("N", "Y"))
+Brand <- gl(2, 1, 24, labels = c("X", "M"))
+
+detg <- data.frame(Fr,Temp, Soft,M.user, Brand)
+detg.m0 <- glm(Fr ~ M.user*Temp*Soft + Brand, family = poisson, data = detg)
+summary(detg.m0)
+
+detg.mod <- glm(terms(Fr ~ M.user*Temp*Soft + Brand*M.user*Temp,
+ keep.order = TRUE),
+ family = poisson, data = detg)
+sandwich(detg.mod)
\ No newline at end of file
Added: pkg/PerformanceAnalytics/sandbox/Shubhankit/Week6-7/Vignette/Test_Report.Rnw
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/Week6-7/Vignette/Test_Report.Rnw (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/Week6-7/Vignette/Test_Report.Rnw 2013-08-10 11:32:00 UTC (rev 2760)
@@ -0,0 +1,35 @@
+\documentclass{article}
+
+\begin{document}
+
+\SweaveOpts{concordance=TRUE}
+<<>>=
+library(sandwich)
+fpe <- read.table("http://data.princeton.edu/wws509/datasets/effort.dat")
+attach(fpe)
+lmfit = lm( change ~ setting + effort )
+lmfit
+sandwich(lmfit)
+Fr <- c(68,42,42,30, 37,52,24,43,
+ 66,50,33,23, 47,55,23,47,
+ 63,53,29,27, 57,49,19,29)
+
+Temp <- gl(2, 2, 24, labels = c("Low", "High"))
+Soft <- gl(3, 8, 24, labels = c("Hard","Medium","Soft"))
+M.user <- gl(2, 4, 24, labels = c("N", "Y"))
+Brand <- gl(2, 1, 24, labels = c("X", "M"))
+
+detg <- data.frame(Fr,Temp, Soft,M.user, Brand)
+detg.m0 <- glm(Fr ~ M.user*Temp*Soft + Brand, family = poisson, data = detg)
+detg.m0
+sandwich(detg.m0)
+detg.mod <- glm(terms(Fr ~ M.user*Temp*Soft + Brand*M.user*Temp,
+ keep.order = TRUE),
+ family = poisson, data = detg)
+sandwich(detg.mod)
+@
+
+
+
+
+\end{document}
\ No newline at end of file
Added: pkg/PerformanceAnalytics/sandbox/Shubhankit/Week6-7/Vignette/Test_Report.pdf
===================================================================
(Binary files differ)
Property changes on: pkg/PerformanceAnalytics/sandbox/Shubhankit/Week6-7/Vignette/Test_Report.pdf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
More information about the Returnanalytics-commits
mailing list