The Trendy application is being retired in the new year. The new web application, ThingSpeak, offers similar functionality. We recommend that active Trendy users who are looking to create new trends use ThingSpeak. To begin collecting your data in ThingSpeak, please read the tutorial : ThingSpeak for Trendy users. Although Trendy no longer allows the creation of new trends, the application will still remain accessible until January 13, 2016. Until that date, you can view your current trends and download your data. After that date, your data will no longer be accessible. Thanks for using Trendy and we encourage you to check out ThingSpeak.

Close-button

Plot for Truthfulness of certain Political Figures

Included from trend description:

This data is a representation of data taken from:

www.politifact.com

The data is a normalized value of truthfulness for each person, where 1 is always tells the truth, and -1 is always lies.

I was inspired by:

http://www.mathworks.com/matlabcentral/trendy/trends/1471

however, my scoring algorithm uses the following mapping:

 True          =  1
 Mostly True   =  2/3
 Half True     =  1/3
 Mostly False  = -1/3
 False         = -2/3
 Pants on Fire = -1

and then normalizes the data based on the maximum possible score they could have received to reduce the difference between people that have vastly different numbers of entries on the site.

Plot Image
% Truthfulness of certain Political Figures
%   time vector is: time2160
%   data vector is: data2160

people = {'B. Obama','J. Boehner','M. McConnell','N. Pelosi','H. Reid'};

t = time2160;
d = data2160;

for i = 1:length(people)
    diffData(:,i) = diff([-2; d(:,i)]);
    changeLocations{:, i} = find(diffData(:,i));
    changeLocations{:, i} = sort([changeLocations{:, i}-1; changeLocations{:, i}]);
    changeLocations{:, i}(1) = [];
    index{:, i} = false(1, length(d(:,i)));
    index{i}(end) = true;
    index{i}(changeLocations{i}) = true;
end

hPlot = plot(t(index{1}), d(index{1}, 1),'-o',...
             t(index{2}), d(index{2}, 2),'-o',...
             t(index{3}), d(index{3}, 3),'-o',...
             t(index{4}), d(index{4}, 4),'-o',...
             t(index{5}), d(index{5}, 5),'-o');
datetick
legend(people, 'Orientation', 'horizontal')

ylim([-1, 1])

hold on

line(xlim, [0, 0], 'Color', 'k')

ylabel('Truthfulness')
Tags:

Add Tags


0 comments