here<\/a>.<\/p>\nThe R code used in the demo is shown below:<\/p>\n
\r\n# Fama-French Regression example in R\r\n\r\n# Load CSV file into R\r\nff_data <- read.table("ffdata.csv",header=TRUE,sep=",")\r\n\r\n# Extract Fama-French Factors and Fund Returns\r\nrmrf <- ff_data[,2]\/100\r\nsmb <- ff_data[,3]\/100\r\nhml <- ff_data[,4]\/100\r\nrf <- ff_data[,5]\/100\r\nfund <- ff_data[,6]\/100\r\n\r\n# Calculate Excess Returns for Target fund\r\nfund.xcess <- fund - rf\r\n\r\n# Run Fama-French Regression\r\nffregression <- lm(fund.xcess ~ rmrf + smb + hml)\r\n\r\n# Print summary of regression results\r\nprint(summary(ffregression))\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"In this video post, I walk\u00a0 through a\u00a0basic demo showing how to run the Fama-French regression using R. This is my first attempt at doing a screencast, so please let me know if you have any comments or suggestions.\u00a0\u00a0 The demo is easiest to follow\u00a0when viewed in full screen HD.\u00a0 In lower resolutions, the on-screen\u00a0commands\u00a0may […]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.calculatinginvestor.com\/wp-json\/wp\/v2\/posts\/2605"}],"collection":[{"href":"https:\/\/www.calculatinginvestor.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.calculatinginvestor.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.calculatinginvestor.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.calculatinginvestor.com\/wp-json\/wp\/v2\/comments?post=2605"}],"version-history":[{"count":25,"href":"https:\/\/www.calculatinginvestor.com\/wp-json\/wp\/v2\/posts\/2605\/revisions"}],"predecessor-version":[{"id":2632,"href":"https:\/\/www.calculatinginvestor.com\/wp-json\/wp\/v2\/posts\/2605\/revisions\/2632"}],"wp:attachment":[{"href":"https:\/\/www.calculatinginvestor.com\/wp-json\/wp\/v2\/media?parent=2605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.calculatinginvestor.com\/wp-json\/wp\/v2\/categories?post=2605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.calculatinginvestor.com\/wp-json\/wp\/v2\/tags?post=2605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}