They Were There All Along

How much of the rise in COVID-19 cases is due to the great increase in testing these last two weeks of 2021 as people rush to get tested before going to visit friends and family or to attend end-of-year parties? How many of the people who test positive have no symptoms or minor symptoms that they might otherwise have attributed to common cold or normal flu for this time of year? Could they have had COVID all along? I’m not sure I have the answer to those questions. However, I believe those questions should be asked to prevent any unnecessary fear from spreading through the population. Perhaps many of these cases are discovered in people who did not have symptoms. The authorities do not report whether the tests were conducted on people with symptoms. That’s too bad. However, what I can say is that we’ve all seen lines of people getting tested these last two weeks. Even here in Seminole County, Florida (just north or Orlando) we had an event the other day in which people lined up for literally miles to go to a local college to either get tested or to get a home test kit. It almost looked like an evacuation with clogged roads like a bad case of arterial cholesterol. At the same time, a few months ago, a similar event held at the same location was almost unattended.

Almost everything I’ve been hearing from major health organizations is that this mutation is not as severe as others, just more contagious. Again, I don’t know if that is inherently true or if it is because more people are vaccinated and therefore, even if they get COVID in their system, it cannot result in the severe symptoms that it might cause in unvaccinated people.

Finally, I want to add my sympathies to the death of Harry Reid at age 82. He was a Senate Democratic leader, but let’s put politics aside for the moment and honor this man who gave many years of his life in service to this country.

Worse than the Spanish Flu?

Here is a follow-up to my post from yesterday:

The Spanish Flu of 1918 killed between 20-40 million people worldwide and 675,000 Americans in 1918 out of a population of only 103 million Americans.  Today the United States’ population is 330 million which would translate into 2,162 million American deaths. The death count stands at 816,436 today. Thus, we would need to nearly triple the number of deaths to surpass the Spanish Flu death rate as a function of the population. In fact, if ‘only’ 1 in 250 Americans who get COVID die, we would need an additional 336 million people to get COVID to have the deaths surpass the equivalent Spanish Flu death count. That would mean infecting everyone in the US with COVID plus an extra 6 million that we don’t have. Let’s hope that is not a goal. Get vaccinated! Avoid crowds!

Ok, COVID is not funny, but isn’t it ‘fun’ to play with statistics?  

Misleading Pandemic Numbers Lack Context

Back in September, I posted an article about how bias can creep into your analysis. It was the basis for an SQL Saturday presentation I did in Orlando, FL in October. In that presentation, I used example from politics, climate change, rainfall, test scores, and of course, COVID-19.

Apparently, there are others around the country and the world that recognize that some of the hysteria people have every time a new variant of COVID hits the world (I said some, not all) is due to the way the data is presented. In a recent article written by Jim Downs for the Los Angeles Times and republished in the Sunday December 26, 2021 Orlando Sentinel, he explores the possibility that reporting just the number of new cases, or the number of deaths does not provide enough of a context as to what is really going on.

As an example from the past, he refers to a cholera outbreak in the early 1800s in India in which hospital workers treated patients with cholera without contracting the disease. If only the number of cases had been reported, the ‘average’ person might have been worried about contracting cholera from other people they meet in public. However, we now know that cholera was not transmitted by direct contact. That is why the hospital workers were not affected.

In fact, a little later in that century, another cholera outbreak led a London physician to the ‘discovery’ that most of the cholera cases could be traced back to water coming from a specific water pump. This basically means that understanding how a disease spreads and who gets infected and who does not could be important information to understanding the spread of any disease.

Mr. Downs states that understanding the uninfected as well as the ones who were infected but recover is equally as important as the other numbers that we typically see in the media. He mentions some of the same things I talked about in my presentation such as the rate of infections, not just the total number of infections over time. You see, the rate of infections determines whether the disease is growing or dying out. But it is more than that. Location is also important. We have seen in the recent Omicron variant where the rate of infection is growing rapidly in the United States, specifically the southern states while it appears to be abating in South Africa were it first appeared. Does this mean that it has run its course in South Africa? Does this give us information about how long a peak may last? As Mr. Downs says, “Reporting the number of infected is a numerator. We are missing the denominator.”

In my presentation, I clearly showed that the media attempts to portray California, Texas, and Florida as some of the worst states with the highest number of cases. However, these are also the three largest states in the United States by population. So, the real question should be, what is the number of case per 1,000 or even 100,000 people in each of these states compared to the US average. Even that however can be deceptive because the cases are probably going to peak at different times with the early peaks being in the Northeast and the latest peaks in the Southeast. This means that comparing rates per 100,000 people in any given week has a location bias. To really understand the situation, one needs to look at the rate during each state’s peak or after the peaks have died down, which they will, what the rates per 100,000 people were in each of the states from the beginning to the end of the Omicron or any other variant.

The same can be said of deaths, although here I prefer to look at deaths per 1,000 people who were infected and if possible, divide these into vaccinated and unvaccinated groups. Even that however, is not good enough. If a person is vaccinated on Monday, it can take several days, perhaps a week or more, for the vaccination to be effective. So, is a person who tests positive for Omicron on Thursday even though they were vaccinated on Monday really a vaccinated case or an unvaccinated case? Pointing to people who have been vaccinated just recently but then when out in a crowd they contract COVID may give people the wrong idea that vaccinations are totally worthless. Thus, the reporting as currently performed provides a disservice to public health promoting vaccination.

Keep in mind that I’m not saying that COVID or even the Omicron variant should be ignored or that it is a scam. Like Cholera, it is a real disease. But we need to avoid the bias of quick numbers that do not consider things like time, location, or even whether the victim recently was in large crowds (more than about 6-10 closely packed people). Should you use this to avoid going to work? In most cases, not at all. Even if your work puts you in contact with a large number of people in any given day, taking precautions like masks will probably keep you safe (Note: I have not seen any statistics on whether COVID victims are wearing masks around large crowds or not.) On the other hand, wearing a mask while driving alone in your car may be just as ridiculous as not wearing a mask in a large crowd.

Perhaps with just a small degree of common sense and concern about the health and welfare of not just ourselves, but those around us, we can make it through this. Remember this, “All Lives Matter”.

 

Has COVID-19 Reporting Caused a Bias in Public Opinion?

Recently I started putting together a presentation about how bias creeps into nearly every analysis of data out there. I maintain that the data itself cannot be biased, but the way that data is interpreted can add a conscious or unconscious bias. I also maintain that any analysis will have at least some degree of bias because the analyst is after all trying to make a point. However, it seems like the levels of bias have reached epidemic proportions since the beginning of 2020.

Of course, there has always been extremes in opinion over many issues. Typically, both sides present data to ‘prove’ they are right. That is what started me thinking, ‘Is there any way to remove/minimize bias from opinions and subsequently charts?’ Let’s first take a look at some of the differences of opinion that created some of the famous bias issues in the past.

Growing up in the 60’s, I was taught in school that continents never changed and always looked like they do today. However, I was fascinated by the then radical theory that South America sort of fit into the outline of Africa and that at one time the two were one land. Of course, today it is generally accepted that continents ‘float’ over the surface of the semi-molten mantle of Earth and in fact all of today’s land masses may have at one time been a single continent. Was this viewpoint a bias or just a lack of knowledge? I’m going to go with the latter.

Of course, who could forget the arguments about whether cigarettes caused cancer with each side creating arguments backed by charts to prove their point.

What about the moon landings in 1969 and the early 1970’s. I watched Neil Armstrong and Buzz Aldrin step onto the surface of the moon via a live television link. Yet many today still believe the moon landings were filmed in a Hollywood sound studio along with 2001, A Space Odyssey. Yes, they pointed at the flag ‘waving’ on a moon with no atmosphere and the lack of stars in the dark black sky. While there are perfectly reasonable explanations for these observations, they dismiss them as lies.

Similarly, it did not matter that while the astronauts were going to the moon that they could see that the Earth was a big rotating ball. Many believed, and some still do today, that the Earth is flat and that the images are just special effects.

Then there are those who believe that we are the only life (perhaps intelligent life although I question that some days) in the universe. Well, at one time people believed the sun revolved around the earth and furthermore that the Earth was the center of the Universe. However, astronomy has expanded our concept of the universe’s size and our latest telescopes like Kepler have already identified thousands of potential Earth-like planets circling the closest stars in our neighborhood. Although we have no evidence of life on these planets yet, the conditions appear to be favorable. But the bigger picture (no pun intended) is that the universe contains billions of galaxies each with billions of stars with billions of planets and many may be favorable for life, so why not? My guess is that there are billions of planets that have intelligent life on them, most are likely more intelligent than us.

But even if intelligent life existed somewhere out there in the universe, they say it could never cross the vast distances to reach us. Even the nearest star, Proxima Centauri is 4.24 light years away which is trillions of miles (nearly 25 trillion miles to be exact). It is only a century ago that most people believed that we could never get to the moon, a mere 238,855 miles on average, because it was just too far, and we did not have the technology to get there. Recently, the New Horizons space probe to Pluto made it past the moon after leaving Earth orbit in a little over 8½ hours. Even at that speed, a little over 28,000 mph, it would take nearly 890 million hours or over 97 thousand years to get to Proxima. Clearly, we need a warp drive or multi-dimensional travel.

These are all weighty problems, problems that science has been able to address which brings us to today’s biggest problem. No, not politics, the elections, or how to balance the national budget although those are areas filled with bias. Picking on politics would be like shooting fish in a barrel. No, I’m talking about COVID-19. From almost the beginning, the press has bombarded us with statistics about how bad COVID is and while there is no doubt that it has resulted in many people getting sick and way too many people dying, some still ask whether the numbers were reported fairly. Both sides of the argument have dug in their heels over the past year with sometimes conflicting statements proving their opinion was the correct one. Yes, there is plenty of data, but it all comes down to how the data is interpreted, reported, and presented to the people. Why? Because most people will not dig into the details to determine when statements contain a bias. However recently, I have seen some improvements. Take the following example.

Recently in the Orlando Sentinel newspaper it was reported that the number of deaths caused by COVID has now reached the number of deaths due to the Spanish Flu of 1918-19 in the United States with over 675,000 deaths. The reporter however did recognize that while that is true, the population of the United States is now about 3 times the US population of 1918-19. Unfortunately, he did not take it one step further to emphasize that the deaths from COVID is only a third of the deaths from the Spanish Flu on a per capita basis. Yes, still serious, but at this time the comparison to the Spanish Flu is not a one-to-one comparison. Yet most people will only remember the headline that the number of COVID deaths has reached the number of Spanish Flu deaths. He also went on to state that global deaths from Spanish Flu were about 50 million while global deaths from COVID are only about 4.7 million at the time of this writing (confirmed with data from the CDC – WHO – ECDC). Let’s twist the Rubric Cube a quarter turn. Using the 675,000 U.S. deaths, the United States accounts for 14.67% of the global deaths today while the U.S. only accounted for 1.35% of the deaths globally from the Spanish Flu. That is an amazing statistic. It should lead the thinking person, like you and me, to ask why is the percent of the global deaths in the United States so much higher for COVID than it was for the Spanish Flu?

Sorry, I do not have a definitive answer, but I do have some clues. The Spanish Flu is known to have killed mostly young healthy adults. On the other hand, a large percentage of the COVID deaths come from the elderly defined as the 65+ group and people with underlying conditions. Since the rest of the world also has a growing group of elderly, it cannot be that simple. What else could it be? Could the higher percentage of deaths due to COVID in the United States indicate that Americans are basically less healthy than the rest of the world and thus more likely to get seriously ill from COVID? Or were at least some of the deaths attributed to COVID really the result of other underlying illnesses that were complicated by COVID?

In related news, according to data published on the CDC website and published by the Denver7 24/7 news channel, the number of confirmed flu cases between September 27, 2020 and May 15, 2021 was only 2,124. To put that number into perspective, the CDC reported on their website that 38 million influenza cases, 18 million medical visits, 405,000 hospitalizations, and 22,000 deaths occurred in the 2019-2020 flu season, just one year prior. In fact, digging into the CDC data shows that the number of deaths due to the ‘common’ flu averages between 12,000 and 61,000 Americans each year. Again, while any number can be seen as too high, the point of this comparison is the exceptionally low number for the 2020-2021 flu season. Maybe the regular flu did not spread because people stayed home and wore masks in public.

Another interesting fact is that while the Federal government promotes vaccination in Americans, there is no mandate for vaccinations such as there was for smallpox, polio, measles, mumps, and rubella to name just a few (see the CDC for a complete list). Each state has slightly different rules especially concerning exemptions, but most states require specific vaccinations before a child can begin school. Initially the shots from Pfizer, Moderna, and Johnson & Johnson were approved for emergency use which may have justified not imposing a public health mandate. However, as these drugs received approval, the drive to reach ‘herd’ immunity faltered yet mandatory vaccination was not implemented. Perhaps people were still afraid of a drug that had only recently received full CDC approval. In any case, President Biden apparently has enough faith in the Pfizer drug to pledge one billion doses to other nations. The Earth currently has about 7.7 billion people so two doses per person will not cover everyone. But here is another interesting twist of the Rubic Cube.

The Federal government decided recently to cut the number of Regeneron (a monoclonal antibody treatment to help reduce symptoms in people with early stage COVID infections) doses to the state of Florida. In the same time period, Florida had the 4th highest death total for COVID in the United States since the beginning in March 2020, however, it is also the third largest state in population dropping it to 11th in deaths per 1000 people. Still, it tried to order 72,000 doses per week and needs at least 36,000 doses to supply state clinics, yet the Federal government cut the number of doses to Florida to under 30,000. With a 7-day average of over 8,000 new cases per day (over 56,000 per week) and over 320 deaths per day, 30,000 doses per week do not seem to be enough. Currently, only Texas has more daily cases. Perhaps the demand is so high that doses must be rationed or perhaps it was because Florida as a state voted Republican in 2020. Who knows?

In another question of ‘who is driving the bus’, the Federal government through President Biden has mandated that all employers of 100 or more employees must be vaccinated or get a weekly negative test result. When many of the testing sites take 4-5 days to return a test result one might ask, what is the point? Yes, the Abbott Labs at-home test kit, BinaxNOW, can provide 15-minute results, but they cost a little over $10 per test that you will have to pay out of your pocket. Furthermore, they appear to be in short supply. Anyway, at the same time, there is no requirement for vaccinations of customers and furthermore, you cannot ask a customer if they are vaccinated. In fact, the Department of Health says they will fine businesses and government groups $5,000 per violation for requiring customers to show proof of COVID vaccination. How can you require vaccines for employees but not apply the same standards to customers? Seems like a bias to me or at least some confusion as to who is driving the bus.

One last point as this post has already gotten too long. Some doctors say the solution is vaccination and masks while others like the new Surgeon General for the State of Florida call vaccinations a religion and that people should just lose weight and eat more fruits and vegetables. So, if vaccinations are a religion, does the refusal to get a vaccine shot amount to a religious exemption? Going back to a prior point, is the Surgeon General trying to imply that Florida’s high death rate is because too many citizens are obese, out of shape, and eat too much fast food?

Anyway, this should give you something to think about the next time you hear the media quote numbers or percentages. Use your own common sense. Seek out the actual data. Population data and COVID case and death numbers are easily available online. Remember that the data itself is not bias. However, the way people interpret and report on the data often does insert a bias. Do your own math. It is really that simple. Remember that while bias in the presentation of data sometimes leads to a better understanding of what is going on, that is not always true. You need to educate yourself on the issues and that does not mean following social media, even this one, blindly. Even the biggest lies have some truth in them to make them believable and even honest people can sometimes interpret that unbiased data wrong.

My SQL Saturday presentation at the end of October here in Orlando will examine bias in data charting and how bias can be used to make a point or disguise reality.

By sharepointmike Posted in Opinion

Fixing Color Contrast Issues

One of the more common compliance issues with ADA (Americans with Disabilities Act) is also one of the easiest to fix. Color contrast in relation to the text on the background requires that the text be easy to read by all users who access your website visually. Color contrast measures the difference between the font color and the background color on which the font is placed. The rule is quite simple:

  1. Text consisting of a font that is greater than 14 pt bold (19 px) or 18 pt normal (24 px) must have a 3:1 contrast ratio with the background on which the font is displayed.
  2. All other smaller text must have a contrast ratio of 4.5:1.

How do you calculate the color contrast between your font text and its background? You don’t need to know how to perform the calculation. There is a free tool that you can download and keep open on your desktop at all times so you can check the color contrast of everything you create. It was created by The Paciello Group and can be downloaded from this URL: The Paciello Group website – Colour Contrast Analyser.

But if the color contrast is not sufficient, how do you fix it. Well, of course, you try randomly selecting different colors, shades, hues, or tints of the original color until this tool calculates a satisfactory contrast ratio. For example, suppose the Colour Contrast Analyser was looking at a light blue (Hex: #1AB4E7) font on a white background (see image below). The initial colour contrast ratio is 2.4:1 which is too low even if the text was larger. You might think that the light blue on white looks good to you. However, you are not everybody and some people have more difficulty with colors than others. Thus, the Americans with Disabilities Act had to create a set of rules that were testable and verifiable to ensure a contrast that most people would find the resulting text to be easy to read against the background.

One way to ‘fix’ the problem is the click the dropdown arrow to the right of the box that displays the color which opens a grid of different colors as well as several different tints (adding white) to the base color and shades (adding black) to the base color. Because we want to increase the color contrast, we would perhaps try some of the shades. In the image below, the mouse is pointing to the second shade in the second (‘Shades’) row which has a hex value of #1487AE.

Colour Contrast Analyser dialog showing how you can test the contrast of other color combinations

However, even this shade of blue is not dark enough to contrast with the white background resulting in a value of 4.1:1. Good enough for larger text, but if the text is smaller, it still falls below the 4.5:1 requirement. We could go back to select the middle box (#0D5A74) which results in a great contrast of 7.7:1. However, it may be too dark. I am not going to go through the trial-and-error steps here of going back and forth between lighter tints and darker shades until you find one that just satisfies the 4.5:1 rule without deviating too much from your original color. Rather, I am going to introduce you to a second tool that can help you find a satisfactory color without all that trial and error.

The tool that I found is called the Tanaguru Contrast Finder. This tool, while free, is not something you need to download. Rather just go to the Tanaguru home page for the contrast finder.

Open the Tanaguru site to use the Contrast Finder tool

This tool’s home page lets start by specifying both the initial foreground (1) and background (2) colors. You can specify these colors either using the decimal values of the RBG color definition or you can enter the hex value of the color

Defining your foreground and background colors in the Tanaguru Contrast Finder

Next, you can select the minimum colour contrast ratio you must meet (3). If the text is smaller, select 4.5 as shown below. For larger text, select 3.1

Defining your contrast ratio goal and what you will allow the program to change to meet that goal

You can then select which color you want to change (4). In the case of regular text on the web page, you generally want to keep the page background color consistent across all of your pages. Therefore, I would change to the Edit the foreground color option.

You can also ask for colors that are very close to the initial color or a range of valid colors(4). I would in most cases go with a valid color very close to the initial color unless the contrast is too far from the ideal value in which case, I might ask for a range of valid colors to pick from.

When all the settings (1-4) are complete, click the Check and find contrast button (5). This is where the magic occurs.

After clicking the Check and find contrast button, the bottom half of the page is filled with possible colors that meet or exceed the color contrast you selected.

Output from the Tanaguru Contrast Finder of recommended colors to meet your contrast goal

First, it shows the original foreground and background colors to give you a reference. To the right, there is a sample of the text so you can see what it would look like on a web page followed by the calculated contrast ratio.

Beneath the original colors, you see the possible colors the algorithm has selected. Even if they all look a little similar to you, the actual RGB values displayed in the leftmost column show that these really are different shades of blue. Note that the ratio column shows a calculated ratio of 4.5 or greater for each of the color combinations.

What I find instructive in training your eye to spot questionable color contrast text is to focus on the sample text from about 4-5 feet away. No matter how good your vision may be, you will often see a significant difference between the original colors and the selected colors, especially in this case.

Another example is the following image fragment from a web page I ran across. The first thing that my eye picked up was the green text on the white background. Indeed, this combination is only 2.5:1. However, not as obvious to most web page editors is that the red used in this table also has a low contrast to the white background. While it is better than the green, it still is only 4.0:1 which is below the required color contrast ratio of 4.5:1.

Example of low contrast text colors on a white background.

In fact, this shade of red is often picked out of a grid of colors as shown in the font color grid within the editor. As shown below, a pure red that also has the RGB value of (255,0,0) may seem at first to be a good choice because it may appear to be a bright red on a white background. Note, however, that bright colors often have poor contrast on a white background but may work fine on a dark background. Keep this in mind: the color selection dialogs in almost all cases have no idea what the background color will be. Therefore, it displays a range of colors, some of which may work with your background color, and many that will not. It is your responsibility to determine if the resulting color contrast with the background color is acceptable.

Typical color grid for selecting a font color

In this case, the darker red to the left (#C00000 or RGB(192,0,0) actually provides a good contrast with white resulting in a contrast ratio of 6.5:1. Don’t even get me started on orange on white or even worse, yellow text on white

When you have text on a colored background such as the image shown below, the situation is much more complex because you can tweak both the font color and the background color to achieve the desired contrast ratio. (Yes, even text in images must meet the color contrast rules stated previously.) In this image, the yellow on the blue text has a ratio of only 2.1:1, the white font on a blue background is a ratio of only 2.4:1, the blue text on beige is only 2.2:1, and the red-orange on beige is a mere 1.6:1. I’m not even going to get into the effect on the crispness of the text when the image size is changed as was done here.

Colored text on different colored backgrounds

In a case like this, if you have access to the original graphic and can change the colors before you post the image, you must do that. Even if the image comes from a third party as is probably the case in this image, you cannot pass responsibility back to the third-party and use the image anyway. Either they must supply an image that satisfies ADA guidelines, or it cannot be used on your site.

Furthermore, this image contains substantial text that the vision impaired using a screen reader will not be able to ‘read’. Therefore, the text must either appear in the alt-text of the image or if there is too much text there (generally alt-text should be less than 160 characters), then the text should be elsewhere on the page or on a separate page linked from the ‘longdesc’ field of the image. In this case, to ensure ADA compliance, I would probably not use the image and just enter the text manually in a content portlet for the page.

In general, when looking at your page, you must consider people with all types of accessibility challenges such as:

  • Visitors with low color contrast vision.
  • Visitors who use screen readers to read the page contents.
  • Visitors who have low hearing ability should your page use sound or voice.
  • Visitors who cannot use a mouse to navigate around the page.
  • Visitors who are affected by flickering images from animated gifs.

Putting yourself ‘inside the heads’ of all of these different visitor types is a challenge, no doubt. However, it is what is required of an accessible web page.

One last point, all of the above applies not only to websites but to any content you make available to others within or outside of your organization because you just don’t know what challenges they may face.  It simply is the right thing to do.

By sharepointmike Posted in ADA

Tale of the alt, title and longdesc Attributes

Most of you probably know that the alt attribute found in the <img> tag is used by screen readers to assist the visually impaired and blind. What is alt text in the first place? It is the text that appears in place of the image if the user turns off graphics or if the user is using a screen reader as is the case for blind or visually impaired visitors to your site.

Is alt text always needed? Well the answer to that question begins with the question whether the image adds to the understanding of the other content on the page. As an example, look at this image found at the top of a page describing an art course:

Example of decorative image that should have a null string for the alt text

Or even the following image found in the page header of an elementary school.

Example of decorative image in a page header that should have al null string for the alt text

Do either of these images add any additional understanding of the art class page or the elementary school page? Would a user who turned off graphics or was blind or visually impaired and could not see these images really understand the rest of the page any less if they never knew the images existed? I would argue that they would not miss a thing. Therefore, these images are considered to be a decorative element on their respective pages and the alt attribute should be set to the null string as in the following: (not the word null)

alt=""

In addition, the title attribute should not be included for decorative images while it usually has the same text as the alt attribute. Strictly speaking, the title attribute is what the page visitor sees when they hover over the image with their mouse while the alt attribute is used by many search engines to catalog the image. So, having both of these attributes set to the same text is really not a bad thing.

Consider the following image with no text. How does it support the other content on the page?

Student races the car he built in the Engineering Magnet program.

In this case, you might have the alt text:

alt="Student races the car he built in the Engineering Magnet program."

Does it matter that the car is blue, the grass is green, they are on an athletic track, or that the student is wearing a helmet? Depending on the purpose of the story, the alt text shown above may be enough when combined with other content on the page.

On the other hand, suppose the image contains text as in the following image:

Example of image with simple text in it that says: Physical Education

While the image itself may not add to the understanding of the content on the page, the text must be included at a minimum in the alt attribute as in:

alt="Physical Education"

Note that the alt text must convey the same information as the text in the image. It is not necessary to say that it is the “Physical Education Banner” or “Physical Education Logo”. Adding words like “banner”, “logo”, “picture” or “image” is considered superfluous.

Some images have text that must be repeated in the alt attribute such as for the following image:

A blue T-shirt that says: We're all in this together

alt="A blue T-shirt that says: We're all in this together".

On the other hand, names on the sides of buildings, text in store windows, etc. if not pertinent to the content of the page do not have to be mentioned.

Sometimes the alt text can even be simplified. It is not always necessary to repeat the image text word for word as long as the meaning and intent are the same such as in the following image.

Image that says: Click image for information about distance learning for parents

alt="Click image for information about distance learning for parents"

Also, it is acceptable to convert the text to upper and lower case, define TLA (three-letter acronyms) as long as the converted text does not change the fundamental message of the image text.

What if the image and the text on the image do add substantially to the understanding of the page or even the purpose of the image. Then that information must be provided to the visually impaired in some way. If the image description is short or if the text is short, as we saw above, then the alt text can provide that additional information easily. But what if it is not short? While there is no physical limit on the length of alt text, it is recommended that alt text is kept short, 125 characters or less. Is that really enough to describe the image and the text on it? Take a look at the following image.

Image with more text than an alt attribute should have

Repeating all of this information in the alt attribute with only 125 characters or less would be impossible. This was the intended purpose of the longdesc attribute.

However, contrary to popular belief, the longdesc attribute is NOT a place for directly entering longer text, perhaps paragraphs or more in which to explain the image or the text on it. Rather, the longdesc defines a URL where the visitor can get more information about the image and/or the text on the image. While the status of the longdesc attribute is not entirely clear under HTML5, the main point is that it is not a duplicate of the alt attribute text nor is it a more detailed explanation of the image even though longdesc sounds like long description. It is a reference to a bookmark on the page or to the relative or absolute URL address of another page that describes the content and/or text in more detail.

In the above example, we might have the text of this information repeated elsewhere on the current page. If so, we can identify the content section by adding an id attribute inside any one of the following content tags that precede the content:

<p id="GraduationEventTimes">

<h3 id="GraduationEventTimes">

<div id="GraduationEventTimes">

(Note: Each id value can only appear once on a page. Otherwise, how would a link know which location to branch to. Make sense?)

Then in the longdesc attribute of the image, we would include the following:

longdesc="#GraduationEventTimes"

Note that the name assigned to the id attribute can contain only upper and lower case letters, no space, no numbers, and no special characters. When the id is referenced, it must begin with the ‘#’ sign to identify it as a bookmark name and not a page name.

It is also possible to reference another HTML page found at the same level as the page with the image. Suppose this page was given the name: “GraduationEventTimes.html” or “GraduationEventTimes.asp”. Then the longdesc attribute would be:

Longdesc="GraduationEventTimes.html"

Note the absence of the ‘#’ symbol, in this case, to identify the relative reference URL as another page on the same folder level as the current page.

You can also use relative URL references to traverse your folder structure, but that is a more advanced topic than what I wanted to cover here.

It is even possible to reference a page using an absolute reference that might exist on an entirely different site such as:

Longdesc="https://myschoolsite.edu/Seniors/GraduationEvents.hyml"

Relative and absolute references are actually the preferred way to handle charts and graphs in which the longdesc attribute points to a ‘hidden from menu’ page that describes the data used to create the charts and graphs and perhaps even includes the actual data tables used by them. Obviously, that much information would never fit within the limits of the alt attribute.

Anyway, I hope you learned something here about the alt, title, and longdesc attributes found in the <img> tag and to not use the longdesc attribute just to insert additional text describing the image or text in the image.

Monetary vs Fiscal Stimulus

Because I have an MBA (in addition to working in SQL Server and Power BI and because I am interested in the financial analysis side of things), a few people have asked me to explain the difference between Monetary and Fiscal stimulus when it comes to the way the federal government is fighting to keep our economy from falling into a depression at this time of the Coronavirus. So, let me give it my best shot.

Monetary stimulus is often associated by changes by the U.S. Federal Reserve to the interest rates charged to banks for loans. The theory being that as interest rates are lowered by the Federal Reserve, those banks in turn will make more money available to business, especially small business at lower rates. If this occurs as expected, it may help to keep small businesses which our country relies on from going out of business because they cannot otherwise pay their debts, their employees, and the cost of materials they need to conduct business. The Federal Reserve, I believe, can even now buy corporate debt to help those businesses survive.

Fiscal stimulus on the other hand consists of tax cuts, unemployment benefits, credits, government spending on infrastructure (which we could probably use) and even direct payments to individuals and families such as those checks many of you have recently received. This is money directly to individuals, not businesses. This is an entirely different tool than Monetary stimulus.

Still don’t see the difference? Think of it this way, Fiscal stimulus is the direct transfer of money from the federal government to the public through one or more different methods with no expectation of getting that money back. Yes, this increases our national debt and will someday in some way have to be repaid. If the economy soars, this can be done through normal fiscal methods without undo taxing of businesses and individuals would could hurt the economy. Only the spending on infrastructure has some ‘public’ return in the form of perhaps better roads, repaired bridges, and updated water and sewer lines. The rest of the fiscal stimulus is simply a hand out of money in the hope that people will pump it back into the economy to buy goods and services that they might not have bought before. If people just put it in their savings accounts, it will not help at all which is why most fiscal stimulus plans phase out as individual or family income rises.

On the other hand, Monetary stimulus does not simply hand out money. It is effectively money used for loans to business which the government expects to paid back at some time in the future. Even when the Federal Reserve buys corporate debt, they expect that debt to be paid back at some time in the future. Monetary stimulus also does not apply typically to individuals the way Fiscal stimulus does.

So, I hope that helps you understand a little about what is going on in the news these days. This will eventually all pass and we can get back into Power BI features and capabilities.

By sharepointmike Posted in Finance

Irresponsible Coronavirus Reporting?

All over the internet you see statistics about the Coronavirus. Yes, statistics are great to have, but without some basis, the numbers can be deceiving. For example, comparing the total number of cases or the total number of deaths by country and then ranking them that way is deceptive. Why? Because not every country has the same population! Duh! The real statistic that would be important to show is which country has been hit the worse, to compare the number of cases or deaths base on cases per 1000 people or any other consistent number. Of course, you may argue that we really don’t know the total number of cases or deaths because it is a given that the entire population of every country has not been tested and perhaps not all deaths have been reported as corona-related. Also, true. So, what does the statistic really tell us? Perhaps only that the coronavirus is something that needs to be addressed and that social distancing may have an effect in slowing it’s spread. It may even tell us within a country, a state, or even a county when the bell curve of new cases would indicate that the crisis is over. Of course, keep in mind that as more testing has occurred, the number of cases could grow, especially with milder cases that might not have been tested in the past because they did not have the symptoms to warrant testing. But should simple counts be used as a ranking tool? No!

I also why recovery counts are no longer typically shown. Total cases should be the sum of: Deaths + Recovery + Still Sick. To give us Total and death counts only is an incomplete picture of what is really going on.

A similar situation occurs here in the United States. Ranking states by the total number of cases or deaths is just as phony because not all states have the same population. It is entirely possible for a state with a total population smaller than another state may have a higher case or death rate. Does that make one state ‘safer’ than another and warrant earlier opening of that state? Should it be based on the state population? Again, cases per 1000 people to me is a much better way to determine your potential exposure to someone with the virus? Of course, even state number are somewhat deceptive as well as areas with greater population density are more ‘dangerous’ than areas that are sparsely populated.

I’m not going to repeat the above when it comes to comparing one county with another within a state, but you get the point by now right? Population density must be considered when determining how safe an area may be. If you are walking around in an area of low population density, you may see very few people while you are out, but if you work in one of the major metropolitan areas around the country, you might have close encounters of the contagious kind much more frequently.

As someone who is interest in Power BI, you know that statistics must be crafted carefully so as not to deceive or present an incorrect or distorted conclusion. That is something we all must be careful of when using Power BI to show statistics.

By sharepointmike Posted in Opinion

Working with Themes – Part 8

In Part 1 of this series, you learned how to use some of Power BI’s built-in.   

In Part 2 you learned about Microsoft’s Theme Gallery.    

In Part 3, you learned how to use the new Customize the Current Theme. 

In Part 4, you learned how to export your customized theme and to use it in your future Power BI report projects.   

In Part 5, you learned how to create a simple JSON theme file for your future Power BI report projects.  

In part 6, you learned about a few of the more common attributes used to customize the color of elements in the most commonly downloaded visualizations.

In part 7, you learned about a few more generic classes that define the colors for conditional formatting and KPIs.

By now you have seen several cases where the colors of some elements would change ‘magically’ when you apply a new theme to your reports. This is part of the artificial intelligence behind Power BI that looks at the color changes that have been applied by a theme and attempts to ‘adjust’ colors of other elements that have not been specified by the theme to something that should be compatible. If you remember, I touched on the fact that background colors appeared to change with some themes that defined only the dataColors array, but then was able to modify the background color by specifically using the background class. However, supplying a background class color also appeared to change the colors of other elements. I will not pretend to understand how that is done by Power BI so I am going to remind everyone of Arthur C. Clarke’s quote from “Profiles of the Future”: “Any sufficiently advanced technology is indistinguishable from magic.” However, if you can wrap your head around a hierarchy of color elements in which Power BI generates default values only if you do not define the color of those elements directly, you are on the right track to understanding how to control your theme colors.

That being said, as we dive further into the capabilities of JSON defined themes, we find additional ways to define those deeper elements which previously Power BI generated colors for when we did not specify them in our themes.

This week, I want to look at what Microsoft calls structural colors. Every visualization has some sort of structural element. These are typically elements outside of the typical data elements that are being displayed. They have been divided into first through fourth level elements. There is also a class for general background and for secondary background colors as well as Table Accent colors which is basically the grid outline.

Here is the problem, or challenge depending on how you look at it. How do you remember which structural elements appear in which of these 7 color classes? Honestly, I have not found an easy answer to this question other than to keep handy the table supplied by Microsoft (found in the How to Create a Theme link at the bottom of the ViewàThemes dropdown menu) and displayed below.

When you look at the table, notice that several class names have (deprecated) after the name. This does not mean that the entire class has been deprecated. Rather only an old name for the class has been deprecated. For example, the class name ‘foreground’ has been deprecated and is now known as ‘firstLevelElements’. Perhaps a comma between the new and old class names would have helped clarify that. Therefore, in my table below, I’ve added those commas. I’ve also added commas in the right column to help clarify what structural elements each color class formats.

As mentioned above, you should also note that we have seen three of these color classes before when we used the class names: background, foreground, and tableAccent. In fact, these three color classes appear in many of the themes that you can download from the Theme Gallery. They are used to provide compatible colors for many of the structure elements when using these themes. However, the class ‘foreground’ is being deprecated and should be replaced going forward with ‘firstLevelElements’. While both class names will work at the time of this writing, it is something that you should be aware of because someday the ‘foreground’ class will no longer be accepted when loading a theme. I am hoping that this will not affect older reports that previously applied themes with the deprecated class names. However, I have no secret insight on that question.

In the following table, you can see 7 color classes

Color class What it formats
firstLevelElements,

foreground (deprecated)

Labels background color (when outside data points),
Trend line color,
Textbox default color,
Table and matrix values and totals font colors,
Data bars axis color,
Card data labels,
Gauge callout value color,
KPI goal color,
KPI text color,
Slicer item color (when in focus mode),
Slicer dropdown item font color,
Slicer numeric input font color,
Slicer header font color,
Scatter chart ratio line color,
Line chart forecast line color,
Map leader line color,
Filter pane and card text color,
secondLevelElements,

foregroundNeutralSecondary (deprecated)

“light” secondary text classes,
Label colors,
Legend label color,
Axis label color,
Table and matrix header font color,
Gauge target and target leader line color,
KPI trend axis color,
Slicer slider color,
Slicer item font color,
Slicer outline color,
Line chart hover color,
Multi-row card title color,
Ribbon chart stroke color,
Shape map border color,
Button text font color,
Button icon line color,
Button outline color,
thirdLevelElements,

backgroundLight (deprecated)

Axis gridline color,
Table and matrix grid color,
Slicer header background color (when in focus mode),
Multi-row card outline color,
Shape fill color,
Gauge arc background color,
Applied filter card background color,
fourthLevelElements,

foregroundNeutralTertiary (deprecated)

legend dimmed color,
Card category label color,
Multi-row card category labels color,
Mulit-row card bar color,
Funnel chart conversion rate stroke color,
Background Labels background color (when inside data points),
Slicer dropdown items background color,
Donut chart stroke color,
Treemap stroke color,
Combo chart background color,
Button fill color,
Filter pane and available filter card background color,
secondaryBackground,

backgroundNeutral (deprecated)

Table and matrix grid outline color,
Shape map default color,
Ribbon chart ribbon fill color (when match series option is turned off),
tableAccent Overrides table and matrix grid outline color when present

So, suppose we created the following theme. Yes, this is still a theme even though we did not define values for the dataColors array element.

A Theme does not require the dataColors element

If you did not get what you wanted or expected when you applied this theme, maybe you need to combine everything we learned so far into a more complete theme definition such as:

A modify theme combining new formatting elements with dataColors

Anyway, I leave you to ‘play’ with what you have learned so far to see what new themes you can come up. In any case, we have not reached the bottom of this deep dive into themes yet. Stay tuned. Next time I will show you how to manipulate text families, colors, and sizes.

This Saturday, I will be speaking at SQL Saturday, Tampa on this theme, so to speak. If you are planning on attending, stop by my afternoon session or look for me to say, “Hi!”

Working with Themes – Part 7

In Part 1 of this series, you learned how to use some of Power BI’s built-in.

In Part 2 you learned about Microsoft’s Theme Gallery.

In Part 3, you learned how to use the new Customize the Current Theme.

In Part 4, you learned how to export your customized theme and to use it in your future Power BI report projects.

In Part 5, you learned how to create a simple JSON theme file for your future Power BI report projects

In part 6, you learned about a few of the more common attributes used to customize the color of elements in the most common visualizations

In this post, you will see a few more of the more attributes used for specific visualizations. The first four are used for conditional formatting but only when you format the values using a color scale. In the figure below, you see the default colors used for a color scale with a divergent value. Typically, the divergent value is centered on the middle value. More specifically, it is the average value between the minimum and maximum value, not a median value as you might at first think.

Conditional Formatting using a color scale

In my sample Contoso data, I used this conditional formatting to color the background of the Sales Amount for each country. Immediate you should notice that most of the values have a red background and only the United States has a green background. The only obvious color variation is for a few countries down the list including: China, Germany, France, and Japan. The rest look very close to the same color as the minimum color. The reason for this is that middle value is (1,951,503,966.95 + 4,693,341.12) / 2 or 979,598,654.04 is significantly larger than most of the values in the table. While China comes the closest to this value, it is still only 2/3 of the middle value. Therefore, even it has a color that is on the red side of yellow (the ‘center’ color) on the scale.

Color Scale does not show much color variation in a table with one extremely large value

One way to provide more color variation is to change how the divergent color is defined. Instead of using the middle value, click the dropdown to the right of ‘Middle value’ and select Custom. Then enter a value that you want to be the center. You could determine the median value. However, I’m just going to enter 50,000,000.00

Modify the center value to be custom rather than the middle value.

This change results is a significant improvement in the color gradients between the different country’s sales as shown in the next figure.

Conditional formatted column now shows more color variation

Using these default conditional colors could pose a problem for those who are red-green color blind in that they will not be able to easily determine by color alone which countries have the greatest sales. According to the Americans with Disabilities Act (ADA), this needs to be corrected. Now that you know how to build themes, you determine that you can set these colors using four new attributes (Remember, these only apply when the conditional formatting is defined with a color scale.):

Maximum: Defines the color of the maximum value.

Center: Defines the divergent color for either the Middle value or Custom value

Minimum: Defines the color of the minimum value.

Null: Defines the background color for any null value.

Suppose I defined a JSON file as follows.

JSON file to set the color for the Conditional Formatting Color Scale

When I apply this custom theme, my sales table conditional formatting changes to look like this:

Table showing the conditionally formatted colors from the JSON file

You might be interested to know that if you are using the new Customize Theme tool, these colors (except for NULL) correspond to the Divergent colors found on the Name and Colors page of the tool.

The conditional formatting colors are in the Divergent Colors section of the Customize Theme Tool.

Next, there is another set of colors that are used in waterfall charts and KPI visualizations. But what are these visualizations and why would you use them.

What is a waterfall chart? A Waterfall chart is a type of column chart that shows the change in a value from one period to the next. A line between two adjacent columns indicates the value of the measurement between the two time periods. If the right-side column rises, this is generally considered good. It the column falls, this is generally considered bad. Personally, you might want to use a waterfall chart to visually display the monthly fluctuation in your stock portfolio. The resulting waterfall chart can show the increases and decreases of your investment on a monthly basis over a year. The first column (leftmost) indicates the performance of your portfolio in the first time period (month). In the figure below, the initial investment of $50,000 fell $500 in the first month. The last column (rightmost) indicates the performance during the last period (month) which in the figure shows an increase of $2,470. The difference between the last column and the first column indicates the overall performance of the portfolio. In this figure, the difference between the start value of $50,000 and the ending value of $100,000 indicates a doubling of the investment in the year. Note that this chart displays the actual investment values. However, it is also possible to create a chart that works only with differences from the initial period and thus would start at zero.

Waterfall chart example showing monthly portfolio values

What is a KPI? KPI stands for Key Performance Indicator. They are used to measure a business factor and compare it to a goal rather than to just measure the change from the prior period such as in a waterfall chart. For example, if your company has a goal of growing sales 1% per month, you could then measure actual sales against this goal value to determine whether you are exceeding, meeting or falling behind that goal.

The colors used for these two different visualizations correspond to the following JSON attributes:

Good: Exceeding a KPI goal or an increase in the measured value during the current time period in a waterfall chart.

Neutral: Meeting a KPI goal or no change in the measured value during the current time period in a waterfall chart.

Bad: Falling behind a KPI goal or a decrease in the measured value during the current time period in a waterfall chart.

However, as in the case of the conditional formatting colors, the default colors use both red and green which could be a problem for those with red-green color blindness. These colors for KPIs and Waterfall charts can be found the Customize Theme tool in the Sentiment Colors area of the Name and Colors page.

Waterfall and KPI colors are in the Sentiment Colors of the Customize Theme tool

Therefore, you might want to change one or both colors as shown in the following JSON code:

JSON file to modify the Waterfall and KPI colors

After applying the theme, you can see that the Sentiment colors have been updated.

Sentiment colors in the Customize Theme Tool after applying the JSON file

I’ll leave it as an exercise for you to try this with your own data.

We still have a little more to examine as we dive even deeper into the JSON behind the themes.

C’ya next time.