Posts

Showing posts with the label logistic

Cultural Dimensions and Coffee Consumption

Image
Photo by Viktoria Alipatova from Pexels Responding to a Treehugger article, Why Americans will never love tea as much as coffee , I initially wrote my personal preferences for tea and coffee , ending with, BTW, this has just given me an idea for comparing Hofstede's cultural dimensions and coffee and tea consumption. Afterward, I did some analysis in Excel, then ran the same processes in R using Visual Studio, then converted that to a Jupyter Notebook on Microsoft's Azure Notebooks . Although this analysis is limited to 45 countries that have Hofstede's Cultural Dimensions , as well as per capita consumption for both coffee and tea, it would seem that coffee consumption correlates with power distance, individuality, and masculinity. Tea had small correlations with the dimensions and sometimes in the same direction as coffee. A fuller analysis is available on Microsoft's Azure Notebook , but some quick findings: Higher power distance, lower coffee consumption

Logistic Regression on Stock Data using Google and SPY (SPDR S&P 500)

As part of a Pluralsight training presentation, Understanding and Applying Logistic Regression , students worked through various exercises, one of which was predicting stock price changes, up or down, on Google, using Google and Spyder closing prices. As an ordered list of actions: Load data - Yahoo financials for each day for 5 years, taking only date and closing price for this analysis Transform sources: Merge sources, change column headings, cast the Date column as DATE type, sort descending Perform logistic regression Create a frame of actual versus predicted changes, and add a column for the correct/incorrect prediction result Find percent correct, on whether the price moved correctly up or down As a result, the lagged Google and SPY prices accurately predict next day prices about 63% of the time. Source data is here . # Clear memory rm(list = ls()) # Set working directory setwd("../Data") getwd() # load data # Data is Yahoo finan