brown wooden floor

Transform Data with dplyr

In this post, we will be exposed to tools for wrangling and manipulating data in R.

Let’s begin by loading the libraries we will be using. We will use the dplyr package and the gapminder package. dplyr is for manipulating the data and gapminder provides the dataset.


You can look at the data briefly by using a function called “glimpse” as shown below.

## Rows: 1,704
## Columns: 6
## $ country   <fct> "Afghanistan", "Afghanistan", "Afghanistan", "Afghanistan", …
## $ continent <fct> Asia, Asia, Asia, Asia, Asia, Asia, Asia, Asia, Asia, Asia, …
## $ year      <int> 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, …
## $ lifeExp   <dbl> 28.801, 30.332, 31.997, 34.020, 36.088, 38.438, 39.854, 40.8…
## $ pop       <int> 8425333, 9240934, 10267083, 11537966, 13079460, 14880372, 12…
## $ gdpPercap <dbl> 779.4453, 820.8530, 853.1007, 836.1971, 739.9811, 786.1134, …

You can see that we have six columns or variables and over 1700 rows of data. This data provides information about countries and various demographic statistics.


The select function allows you to grab only the variables you want for analysis. This becomes exceptionally important when you have a large number of variables. In our next example, we will select 4 variables from the gapminder dataset. Below is the code to achieve this.

gapminder %>% 
        select(country,continent, pop, lifeExp)
## # A tibble: 1,704 x 4
##    country     continent      pop lifeExp
##    <fct>       <fct>        <int>   <dbl>
##  1 Afghanistan Asia       8425333    28.8
##  2 Afghanistan Asia       9240934    30.3
##  3 Afghanistan Asia      10267083    32.0
##  4 Afghanistan Asia      11537966    34.0
##  5 Afghanistan Asia      13079460    36.1
##  6 Afghanistan Asia      14880372    38.4
##  7 Afghanistan Asia      12881816    39.9
##  8 Afghanistan Asia      13867957    40.8
##  9 Afghanistan Asia      16317921    41.7
## 10 Afghanistan Asia      22227415    41.8
## # … with 1,694 more rows

The strange symbol %>% is called a “pipe” and allows you to continuously build your code. You can also save this information by assigning a name to an object like any other variable in r.

country_data<-gapminder %>% 
        select(country,continent, pop, lifeExp)


The arrange verb sorts your data based on one or more variables. For example, let’s say we want to know which country has the highest population. The code below provides the answer.

country_data %>%
## # A tibble: 1,704 x 4
##    country               continent   pop lifeExp
##    <fct>                 <fct>     <int>   <dbl>
##  1 Sao Tome and Principe Africa    60011    46.5
##  2 Sao Tome and Principe Africa    61325    48.9
##  3 Djibouti              Africa    63149    34.8
##  4 Sao Tome and Principe Africa    65345    51.9
##  5 Sao Tome and Principe Africa    70787    54.4
##  6 Djibouti              Africa    71851    37.3
##  7 Sao Tome and Principe Africa    76595    56.5
##  8 Sao Tome and Principe Africa    86796    58.6
##  9 Djibouti              Africa    89898    39.7
## 10 Sao Tome and Principe Africa    98593    60.4
## # … with 1,694 more rows

To complete this task we had to use the arrange function and place the name of the variable we want to sort by inside the parentheses. However, this is not exactly what we want. What we have found is the countries with the smallest population. To sort from largest to smallest you must use the desc function as well and this is shown below.

country_data %>%
## # A tibble: 1,704 x 4
##    country continent        pop lifeExp
##    <fct>   <fct>          <int>   <dbl>
##  1 China   Asia      1318683096    73.0
##  2 China   Asia      1280400000    72.0
##  3 China   Asia      1230075000    70.4
##  4 China   Asia      1164970000    68.7
##  5 India   Asia      1110396331    64.7
##  6 China   Asia      1084035000    67.3
##  7 India   Asia      1034172547    62.9
##  8 China   Asia      1000281000    65.5
##  9 India   Asia       959000000    61.8
## 10 China   Asia       943455000    64.0
## # … with 1,694 more rows

Now, this is what we want. China claims several of the top spots. The reason a country is on the list more than once is that the data was collected several different years.


The filter function is used to obtain only specific values that meet the criteria. For example, what if we want to know the population of only India in descending order. Below is the code for how to do this.

country_data %>%
        arrange(desc(pop)) %>%
## # A tibble: 12 x 4
##    country continent        pop lifeExp
##    <fct>   <fct>          <int>   <dbl>
##  1 India   Asia      1110396331    64.7
##  2 India   Asia      1034172547    62.9
##  3 India   Asia       959000000    61.8
##  4 India   Asia       872000000    60.2
##  5 India   Asia       788000000    58.6
##  6 India   Asia       708000000    56.6
##  7 India   Asia       634000000    54.2
##  8 India   Asia       567000000    50.7
##  9 India   Asia       506000000    47.2
## 10 India   Asia       454000000    43.6
## 11 India   Asia       409000000    40.2
## 12 India   Asia       372000000    37.4

Now we have only data that relates to India. All we did was include one more pipe and the filter function. We had to tell R which country by placing the information above in the parentheses.

filter is not limited to text searches. You can also search based on numerical values. For example, what if we only want countries with a life expectancy of 81 or higher

country_data %>%
        arrange(desc(pop)) %>%
        filter(lifeExp >= 81)
## # A tibble: 7 x 4
##   country          continent       pop lifeExp
##   <fct>            <fct>         <int>   <dbl>
## 1 Japan            Asia      127467972    82.6
## 2 Japan            Asia      127065841    82  
## 3 Australia        Oceania    20434176    81.2
## 4 Switzerland      Europe      7554661    81.7
## 5 Hong Kong, China Asia        6980412    82.2
## 6 Hong Kong, China Asia        6762476    81.5
## 7 Iceland          Europe       301931    81.8

You can see the results for yourself. It is also possible to combine multiply conditions for whatever functions are involved. For example, if I want to arrange my data by population and country while also filtering it by a population greater than 100,000,000,000 and with a life expectancy of less than 45. This is shown below

country_data %>%
        arrange(desc(pop, country)) %>%
        filter(pop>100000000, lifeExp<45)
## # A tibble: 5 x 4
##   country continent       pop lifeExp
##   <fct>   <fct>         <int>   <dbl>
## 1 China   Asia      665770000    44.5
## 2 China   Asia      556263527    44  
## 3 India   Asia      454000000    43.6
## 4 India   Asia      409000000    40.2
## 5 India   Asia      372000000    37.4


The mutate function is for manipulating variables and creating new ones. For example, the gdpPercap variable is highly skewed. We can create a variable of gdpercap that is the log of this variable. Using the log will help the data to assume the characteristics of a normal distribution. Below is the code for this.

gapminder %>% 
        select(country,continent, pop, gdpPercap) %>%
## # A tibble: 1,704 x 5
##    country     continent      pop gdpPercap log_gdp
##    <fct>       <fct>        <int>     <dbl>   <dbl>
##  1 Afghanistan Asia       8425333      779.    6.66
##  2 Afghanistan Asia       9240934      821.    6.71
##  3 Afghanistan Asia      10267083      853.    6.75
##  4 Afghanistan Asia      11537966      836.    6.73
##  5 Afghanistan Asia      13079460      740.    6.61
##  6 Afghanistan Asia      14880372      786.    6.67
##  7 Afghanistan Asia      12881816      978.    6.89
##  8 Afghanistan Asia      13867957      852.    6.75
##  9 Afghanistan Asia      16317921      649.    6.48
## 10 Afghanistan Asia      22227415      635.    6.45
## # … with 1,694 more rows

In the code above we had to select our variables again and then we create the new variable “log_gdp”. This new variable appears all the way to the right in the dataset. Naturally, we can extend our code by using our new variable in other functions as shown below.


This post was longer than normal but several practical things were learned. You now know some basic techniques for wrangling data using the dplyr package in R.

tax documents on the table

Types of Government

In this post, we will look at different types of government.


Anarchy is defined as an absence of government. In practice, anarchies are for the short-term because eventually, from the chaos of a lack of government comes some sort of structure, whether it’s a dictator or king or some other form of government. There is always some ambitious, strong man looking to fill a power vacuum in a place of chaos.

Often after revolutions, there is a state of anarchy. The French Revolution was one example of chaos being the order until Robespierre came to power. The Russian Revolution of the early 20th century is yet another example. In both examples, there was a short period of chaos followed by a strong totalitarian reaction.


Monarchy is a government in which one person is in charge until they die or give up power. Often, the role of a monarch is hereditary but necessarily always. There is also a common claim of divine or supernatural approval. This was often the case in Europe, where monarchs frequently courted papal approval of their rule.


There are generally two types of monarchs. Absolute monarchs have complete power to do as they see fit. This still of government is rare because people generally do not appreciate being under the whim of anybody to such a degree. Many kings from medieval Europe were absolute monarchs.

The challenge of being an absolute monarch is not when things are going well. When there is peace and everybody is happy, the monarch gets all the credit because they are absolutely in charge. However, when things fall apart, the monarch also gets all the blame because they are absolutely in charge.

In addition, people, whether a monarch or not, can be capricious and unpredictable. If the monarch shows inconsistencies or weaknesses, people may try to remove them to protect themselves and their gains within the country. For example, Henry VI of England was removed several times because of the weakness of his character and mental instability. In other words, having this level of power is not as great as it seems.

Another form of monarchy is a constitutional monarchy. In this form of government, the monarch’s power is limited by the constitution. You would think that having a constitution limiting a monarch’s power would irritate them, and it has in some instances. However, the benefit of a constitution is that giving up some power can help a monarch stay in the position of privilege that they have because everything that goes wrong is not completely their fault. Many monarchies today are constitutional monarchies such as Great Britain, and often these monarchs are above politics, which makes it difficult to complain about them as they stay out of governmental decision-making for the most part.

However, even giving up power can lead to a monarchy being removed. Louis XVI of France and Czar Nicholas II of Russia both made reforms before being overthrown. On the other hand, the British monarchy has been stable for decades. therefore, there is no single strategy that can protect a government


Oligarch is government by a small elite. OFten these elites are rather sneaky and work behind the scenes. One reason for this is they do not want to be held responsible if something goes wrong. AS such, it is hard to tell when a country’s government is an oligarchy.

Members of an oligarchy tend to excel at one aspect of society or another. For example, they may be wealthy businessmen, military strongmen, or clergy members. Due to its mysterious nature, it is difficult for others to rise to membership in this exclusive and secretive club.


Dictatorship is power held by a single person. A dictator is different from a monarch because their power is not hereditary, and dictators often arise from a revolution to overthrow another government, so they avoid the word king even if they have the same powers. In other words, they are a king, but that word is not socially acceptable.

Dictators are normally charismatic leaders who rise to power on the back of the people. Once in place, they are looking to find ways to stay in power and are often worst than the people they overthrew. Pol pot of Cambodia killed millions of his own people, Hitler of Germany killed millions of Jews, Idi Amin ran his country into the ground. Each of these totalitarian dictators sought to control as much of the lives of the people under them as they could.


The most popular form of government is democracy. Democracy involves giving all citizens an equal voice in the government. These citizens then elect leaders to represent their interest in the government. In practice, this sounds great, but sometimes it can be frustrating.

People looking for a positi0n of power know that perception is more important than truth. As a result, it is common for politicians in democracies to try and find ways to manipulate their constituencies. Outlandish claims are made in the media; overt and covert lying occurs. All this is done in the name of democracy.

However, this only happens because the citizens often neglect to educate themselves about what is going on. Therefore, people cast votes for controversial topics they have not thoroughly investigated. The point here is not to criticize any position but to wonder if people have really thought about the position they support instead of the one they do not support.


Every form of government has its strengths and weaknesses. Therefore, there is no real benefit in raising one form over another. This is because governments are built upon people. If the people or not good, it doesn’t matter how good the government is.

crop laboratory technician examining interaction of chemicals in practical test modern lab

Moles in Chemistry


In this post we will have a brief introduction to moles in chemistry. This fundamental concepts is a part of Stoichiometry which is another important aspect of chemistry.

In chemistry an atomic mass unit (amu) is the mass of a proton or neutron in an atom. This number has been calculated to be.

1.66 X 10-24 g

Knowing this number we can calculate how much a single atom weighs. For example, if we want to calculate the weight in grams of oxygen, we know know that helium has an atomic weight of 4. This means that

The amu cancel each other. This number becomes important because if we take the amu of 1 atom of helium (or any element) in grams and divide by the mass of one atom in grams we get the following number no mattter which element we use.

This number above is how many atoms in 4 grams of helium. This number is called Avogadro’s constant but it also referred to as a mole. Knowing this value, it is possible to calculate the mass of single mole of a molecule. For example, if we want to know the mass of a single mole of glucose we would calculate the amu as shown below.

The mass is as follows

Element# of AtomsamuTotal
Carbon 612.0172.06
Total = 180.18 amu

This output tell us that one mole of glucose is 180.18 grams. We can use this information in other ways such as determining how many moles are in a certain number of grams of a substance. If we have 15 grams of magnesium chloride MgCl2. We can calculate how many moles are in this substance as shown below

Step 1 Calculate the amu of the molecule

Mass of MgCl2 = 24.31 amu + 2 * (35.45 amu) = 95.21 amu

Step 2 Determine Conversion Reltionship

1 Mole of MgCl2 = 95.21 grams MgCl2

Step 3 Convert from grams to Moles

We now know that there are about 0.158 moles in 15 grams of magnesium chloride. But we could take this a step further by determining how many molecules are in 15 grams of magnesium chloride as shown below

0.158 * 6.02 * 1023 = 9.84 * 1022

The first number is the number of moles in 15 grams of magnesium chloride and and the second number is one mole.

There are many variations on the calculations that were done here but this is enough to serve as an introduction.

gray concrete building

Authority Types

Various countries and governments have developed different forms of authority to maintain power and stability. This post will look at three common forms of authority found throughout the world.

Traditional Authority

As its name implies, traditional authority relies on tradition to maintain its power. Examples of traditional authority usually include monarchies such as those found in Europe at one time. People support the leader because this support has been given for a long time.

The actual leader often does not have power beyond people’s respect for them. The leader can often have a figurehead-type status while others exercise overt power. For example, it is common in many countries with traditional authority to have the monarch avoid politics and serve a ceremonial role.


A variation of traditional authority is called patrimonialism. Patrimonialism is a strong-man character who has a strong administration and military support. Some may see this as a form of military-backed dictatorship. The people under the supreme leader only have their privileges through their obedience and loyalty to the supreme leader.

Charismatic Authority

Charismatic authority generally involves an individual who gains power through the strength of their personality more than on any other single reason. Often this will happen during a time of crisis in which people are looking for help and or protection. One example of this would be Napolean Bonaparte, who rose to power in France after the French Revolution.

However, charismatic leaders often do not last long. There may be several reasons for this. The crisis may worsen, the leader’s shortcomings become more apparent over time, or someone even more popular arises to threaten the leader. These are not the only reasons, but they play a part in the demise of charismatic leaders. For example, Napolean’s shortcomings as a general were the primary reason for his downfall. Though one of the greatest generals ever, he was not perfect, and often leaders are expected to never fail.

Rational-Legal Authority

Rational-legal authority emphasizes laws, rules, regulations, and the office of authority rather than the individual person. Countries with constitutions are often inspired by rational-legal authority. For example, the United States is a strong example of rational-legal authority. They have a constitution and a new president every 4 to 8 years. The power lies within the office, and there is no idea of a single absolute authority but rather an emphasis on “we the people.”

With the focus on laws, all the lawmakers have to do is make illegal things legal and legal things illegal, and there will not be as much push-back from the people because they believe in the rule of law. Examples of this from the United States can include any controversial topic such as sexuality, taxes, reproductive rights, etc. Each of these examples involves actions that were legal, then illegal, or vice versa. In summary, whoever defines the laws appears to have the power in a rational-legal framework.


Countries require leadership, and leaders can have various forms of authority. The examples provided here are just some of the commonly seen options. Naturally, it would be an oversimplification to think that leaders and countries could not mix the examples above. For example, Cesar was charismatic and spent a lot of time passing various laws. The real point here is to be aware of these various styles.

scientist in laboratory

Chemical Equations

Chemical reactions involves the rearrangement of atoms to beget new chemicals. Often these reactions are captured succinctly in what is called a chemical equation. For example, if we want to show how carbon reacts with oxygen to make carbon dioxide we would write the follow chemical equation.


The plus sign means “reacts with” and the arrow means “to make”. Therefore, we can write this chemical equation in English by saying

Carbon reacts with oxygen to make carbon dioxide

Chemical equations need to balance. If you look at the example above, there are the same number of atoms for each element on each side. The example above is rather simple, however, sometimes it is a little trickeier to tell if an chemical equation is balanced.

In the reaction above we have to look carefully to see if the chemical equation is balanced. Starting on the left we have 1 carbon and 4 hydrogens. Next, there is a 2 which means that we multipl everything by 2 that is next to it. In other words, we do not have 2 oxygen atoms but rather 4 (2 x 2 = 4). After the arrow, we have 1 carbon and 2 oxygen atoms and after the plus sign we have 4 hydrogen atoms (2 x 2 = 4) and 2 oxygen (2 x 1 = 2). If we line everything up you can see that this equation is balanced.

Left SideRight Side
C 1 x 1 = 1 1 x 1 = 1
H 4 x 1 = 4 2 x 2 = 4
O 2 x 2 = 4 2 + (2 x 1) = 4

There are times when you need to balance a chemical equation. This can get really challlenging but we will do a simple example below.

The chemical equation above is not balance as you can see below

Left SideRight Side
H 1 x 2 = 2 1 x 1 = 1
Cl 1 x 2 = 2 1 x 1 = 1

The table above is one process in balancing an equation. We need both sides to equal each other and the simplest way to do this is to multiple the right side by two and we get the following table.

Left SideRight Side
H 1 x 2 = 2 2 x 1 = 2
Cl 1 x 2 = 2 2 x 1 = 2

Below is what our balanced chemical equation looks like.

As mentioned previous, placing the 2 in front of the molecule means multiply everything by 2. Such an example like this is really simple but provides a basic understanding of this process.


Chemical equations can be really fun to deal with once you understand how this works. In the beginning, it can be truly frustrating but perseverance will make the difference.

water drop

Physical & Chemical Changes in Chemistry

In this post, we will focus most of our attention on physical changes in chemistry with a brief look at chemical changes.


Physical change is a change to a substance that does not alter the chemical composition. For example, boiling water is a physical change. Generally, physical changes are easy to reverse, such as when steam is cooled to become liquid water.


Chemical change is a change that alters the chemical composition of a substance. An example would be various forms of cooking, such as frying potatoes to make french fries. Unlike physical changes, chemical changes are much harder to reverse. Just as it is impossible to turn french fries back into raw potatoes.

A specific type of physical change is called phase change. There are several different types of phase changes, as listed below.

  • melting
  • vaporizing
  • freezing
  • condensing
  • sublimation

Many of these are obvious, but they will be explained for clarity. Melting involves a substance moving from a solid to a liquid. Vaporizing takes place as a substance moves from liquid to gas. A substance that moves from a gas to a liquid is called condensing. Freezing is the process of a liquid becoming a solid. Sublimation is a solid moving straight to a gas.

The first four-phase changes are commonly seen in water. Ice melts to become liquid water, water boils/evaporates (vaporizes) to become steam. Water freezes to become ice; in the early morning, it is common in many places to see water on plants due to condensation. Sublimation is tricker to see on a day-to-day basis. The most common example involves carbon dioxide, aka dry ice, which is a favorite tool for Halloween. Other substances that sublimate include arsenic, iodine, and naphthalene (used for mothballs).

Phase changes are related to the kinetic theory of matter, which we will now turn our attention to.

Kinetic Theory of Matter

The kinetic theory of matter states that Molceults have space between them and are in constant random motion. We can say that the more heat, the faster the motion because more energy is present. For solid, the molecules can vibrate, but that is essentially it. All solids are vibrating, such as tables, chairs, desks, etc. However, the vibration is random, and thus the vibrations cancel each other.

Liquids can clearly move about, and this is why they cannot keep a single shape but is formed by their circumstances. This also applies to gasses. The real difference between the various phases is the space around molecules and the speed at which they are moving. When energy is added, molecules move apart and move faster. This explains a solid becoming a liquid and a liquid a gas.

Water breaks many rules in relation to the Kinetic theory of matter. When water freezes, instead of the molecules getting closer together, they actually push out and are thus less dense than water. This is one reason why ice floats and why you would find frozen ice on the top of a lake. The ice floats to the top, and by being on top, it insulates the animals inside the lake from the cold above.


Physical changes play a major role in all of our lives. The phase changes of water are used for various purposes in everyday life. It is beneficial to understand these concepts as they are so commonly encountered.

family walking on path

Family Stages and School

Family is a term that is used but not necessarily agreed upon. In this post, we will look at views on family and the stages of family. Understanding the stages of family life will help teachers try to help parents.

Defining Marriage & Family

Family often begins with marriage, and defining marriage has been controversial for years now. Traditional marriage in the West generally involves people of the opposite sex who have some sort of a public ceremony. A family that is formed through marriage is called a family of procreation. Marriage can also be more complex. Some support having multiple partners, which is called polygamy or polyandry (multiple wives or husbands).


Despite being around since the beginning of time, people do not agree on what family is. One definition sees family as the blood relations a person has. However, many people do not grow up with blood relatives and thus may see adoptive parents or friends as family. Sociologists try to deal with this by speaking about a family of orientation which is the family in which one is born or raised.

Stages of a Family

There are seven common stages that a family goes through. Stage 1 is the marriage family and is usually childless. The couple is essentially newlyweds and has not had any children yet. Stage 2 is the procreation stage and involves having newborns to toddlers. This stage is a huge transition as the responsibility of parenthood has descended on a young couple.

Stage 3 is the preschooler family and goes from toddlers until 6 years of age. Generally, kids are not yet in school and spend most of their time at home or daycare. Stage 4 is the school-age family and goes from age 6-13. At this stage, children are in school, are more independent, and the parents can focus more on their jobs and career.

Stage 5 is the teenage family and goes from age 13-20. The children are adults who lack experience and need to be guided by their parents. As they push the limits, parents can begin to worry greatly about the young adults in their house. Stage 6 is the launching family and involves young adults leaving home. This can be extremely emotional as children leave home and parents have to deal with the separation from adult children. Lastly, stage 7 is the empty nest family, which is a family in which the children have grown up and moved away. Now that their children are adults, parents are left with a huge transition as they try to find other ways to invest their time.

Families and Education

The stages are useful but not always accurate. It is common to have children in various age categories simultaneously. For example, have a toddler and a teenager in the same house. Is such a family a preschooler or teenager family? It may not be clear, but perhaps the stage is tied to the individual child instead of the entire family.

For teachers, the stages of the family often involve them dealing with families from at least the stages 2-6. Parents will be in different stages with different children, which may impact whatever children the teacher is dealing with. For example, suppose a 10 year has an older sibling who is leaving for college. In that case, this could cause behavioral problems as the students struggle to accept this separation. In addition, if a 7-year-old now has a baby brother, this could also lead to problems as they adjust to less attention from their parents. These two examples don’t even consider the fracturing of a family through a divorce or the commonly found experience of single parents.


Teachers and families have to work together to help children. This is an idea that seems to have been forgotten over the years. With the challenges of moving through each stage of family life, teachers need to be aware and understand as they try to support the home.

clear glass apparatus on white table

Dalton’s Atomic Theory

John Dalton was an 18th-century scientist who made several significant contributions to his field. One of his most prominent works was his Atomic theory. Dalton’s Atomic theory is a major concept in the study of chemistry. In this post, we will look at this theory and share some of the misunderstandings that Dalton had at his time.

Atomic Theory

Dalton’s Atomic Theory has four propositions to it.

  1. All matter is made of atoms that cannot be divided or destroyed
  2. All atoms of an element are identical in all their properties
  3. Compounds are formed by a combo of two or more different kinds of atoms
  4. A chemical reaction is a rearrangement of the atoms in the substance

There is little to explain here. Part one states that atoms cannot be divided or destroyed. In other words, the atom is the fundamental unit of the universe. Part 2 states that all atoms are identical in their properties, which implies that every atom of an element has the same number of protons, neutrons, and electrons.


The third component states that compounds are formed by two or more different atoms. For example, one compound would be H2O which is water. Since there are two elements in H2O, it meets the definition of a compound. We also call such a compound a molecule. Component four states that a chemical reaction is a rearrangement of the atoms in the substance. An example of this would be digestion which involves significant chemical changes to the food.

Problems with Dalton’s Theory

Despite the brilliance of Dalton’s theory, several problems have arisen as researchers have continued to explore the mysteries of chemistry. For example, the first proposition of Dalton states that atoms cannot be divided or destroyed. Both of these claims are false. We now know that atoms are made of protons, neutrons, and electrons. In addition, atoms can be destroyed, which happens at any nuclear power plant through fission. Nuclear fission involves neutrons hitting atoms which causes them to split.

Dalton was also incorrect regarding his second proposition about the same atoms having the same properties. With the discovery of the neutron, it became clear that atoms may have the same chemical properties but not the same physical properties. The reason for this is that having a different number of neutrons affects the atom’s weight. When atoms of the same element have different neutrons, we call these isotopes.


Dalton’s work in the study of atoms is something to be praised. It is understandable that perhaps he got some things wrong. The purpose of science is to grow and improve over time, and this means that sometimes great scientists are right, but they must also be wrong.

Principal Component Analysis with Python VIDEO

Principal component analysis is a tool for reducing the number of variables in a dataset without losing too much information. This is a great way to summarize information or to simplify things for a more complex analysis. The video provides a simple example of how to do this.


crowd of people black and white photo

Terms Related to Social Stratification

Social stratification is the ranking of individuals using various factors such as wealth, income, education, etc. While I was preparing this post, I could not find any evidence of a classless society. In fact, some of the sources claimed that no such society as a classless one has existed. This implies that stratification is a natural part of human existence whether people like it or not.


What causes this is not always apparent. For some reason, people often like to exalt themselves and be above others. There is a tendency in some people to desire control and dominance. Sometimes people are chosen to be the leader or in a higher social position by others in the society. Leaders often fall into this category and can include politicians, clergy, and kings. Others gain a higher status through hard work, and people admire and appreciate this. For example, Napolean was able to rise through the ranks of the military due to his brilliant leadership and eventually became emperor.

There are also examples in history of people gaining power not just for selfish reasons but for personal protection from one’s enemies. Ceaser was truly driven by a desire to rule, but he also had enemies who were waiting for him to lose power so they could attack him through various legal means. Therefore, Ceasar looked for ways to maintain the leadership of provinces and be consul of Rome to maintain his legal immunity. Even when taking power, he generally would grant amnesty to enemies to avoid stirring up more enmity. However, as he became more powerful, he just became even scarier to the other elites who simply murdered him one day.

The best it appears people can hope for without being cynical is a world in which the elite and upper class refrain from abusing and mistreating the people below. There is also little historical evidence of elite restraint as there is almost no evidence of a classless society. Different people put in different amounts of work, and some find different ways to cheat their way, and thus there will always be differences between the ranking of people.

Caste System

There are several terms related to social stratification. The caste system is one. With the caste system, people are born into a certain level of society, and they are stuck there forever. There is no social mobility. Examples of this can be found in India, Feudal Japan, and Medieval Europe.

Marriages between caste are frowned upon or even illegal. For example, a friend from India told me how they got married. She was from the warrior caste, while her future husband was from the priestly caste. Since they were Christian, they did not think they were bound by the tradition of the caste system and for married. Being it was a Christian community, everyone was okay with it; however, several people were still worried that something “bad” might happen to the newlywed couple because of the country’s cultural background. India abolished the caste system, but its roots are still strong in some situations.

Class System and Meritocracy

The class system is a more flexible style of social stratification in which people belong to one of many different classes based on their wealth, education, etc. Examples of classes can include upper, middle, and lower classes. Unlike the caste system, which discourages marriage, the class system does not generally condemn marriages of people from different classes.

Meritocracy is social stratification based on effort. At best, meritocracy has been partially implemented in many places. No matter how hard humans try, people are just good at findings ways of getting through the system without equal work. This leads to frustration by those who “play by the rules.” Another problem is that some people will achieve a great deal in one area, but this area is not valued as important by society.

Highly educated people often have amazing expertise in minute details of life that are not generally valued by the larger society in terms of prestige and financial remuneration. This can lead to frustration and desires to challenge the social stratification. At times, some of the strongest proponents of a classless society are people who do not have the status they believe they deserve.


Stratification is always going to be a problem. This is because people will always find ways to move up the social hierarchy through honest hard work and abuse the system for personal gain. Unfortunately, people may lose status due to mistakes or injustice, and those who are higher up may mistreat those who are lower, which is not fair or right again.

Data Visualization with Altair VIDEO

Python has a great library called that Altair that makes it really easy to make various data visualizations. The primary strength of this particular library is how easy it is to use and to also create interactive plots. The video below provides an introduction to using this innovative tool.



CASE WHEN statements are similar to if-then statements in other programming languages. These statements are used to have SQL execute certain behaviors as determine by the criteria that is set in the statement. In the video below, we will go through several examples of how to use CASE WHEN statements in SQL.


Making Groupwork Work

For many students, working in groups can be a serious challenge. Different people have different temperaments regarding communication, work style, and ability to cooperate. It can be difficult to have success when a student is compelled to work in groups.This post will provide three tips for improving the group work experience of students.

Example Projects

Perhaps one of the best ways to get students going when it comes to completing group work is to show them how other students have dealt with this problem/project in the past through showing examples. When students see examples, it helps them process what is possible and what the expectations are for earning a certain grade.


Often the struggle with groups is trying to determine what to do. This is usually the first impediment to the project. Examples of prior work help a group determine which ideas they have are reasonable as they try to pivot off what the teacher has shown them as potential projects.

Checkpoints & Communication

It is often common for teachers to assign the entire project and only collect or comment on the final submitted project. This is a high-stakes approach that can lead to frustration when cooperation is not happening for many people working in groups. This is one reason why many students want to work alone to control everything.

A better approach is to break the project into pieces and provide feedback and support at each checkpoint. Students are provided with an opportunity to check in with the teacher as a group and feedback before the final submission. In addition, this also allows the teacher to communicate with students about expectations and address any problems that may have arisen proactively. Sometimes, students will just suffer in their group until the last minute. However, the teacher can guide the group towards success rather than failure and frustration by breaking the project into smaller pieces with frequent feedback and communication. 

Separate Grading

Freeloading is a common problem in group projects. There are always students who believe in doing minimum and even nothing when working in a group. This practice may be one of the main reasons students dislike group work. The project often becomes a solo project in which the smart student does everything. One way to deal with this problem is through separate grading.

Instead of giving one grade that is exactly the same for all members, a teacher can give separate grades based on the contribution of individual members. Often, two grades are provided, one for the entire group project and a second grade for the individual contribution. Doing this makes group members individually accountable for their part.

HOw the individual grade is calculated can vary. Some teachers lick to have peer evaluations as part of the final grade in which members of a group evaluate each other’s contributions. This works in cultures that accept conflict more. However, in more collectivist settings, students will often mark everyone high to maintain harmony even if there is evidence that many did not contribute.

Another approach involves the teacher marking the specific contribution of the individual members. However, there must be some sort of rubric for this to work. Essentially, every group must follow the same process for the teacher to mark them similarly. In other words, the group project becomes a collection of individual assignments that are lumped together as a project. Doing this would limit the flexibility of each group with the tradeoff of higher accountability.


Groupwork has a place in the classroom. It allows students to develop communication skills, compromise, and work in less-than-ideal situations. However, the teachers must find ways to help students succeed in the context of group work so that everyone can perform.

photo of clear glass measuring cup lot

Terms Related to Matter

Matter is the physical stuff that everything around us is generally made of. Trees, birds, water, etc., are all examples of matter. Since almost everything is considered matter, scientists have naturally found ways to classify matter to better understand it.

Types of Matter

One way matter is classified whether it is a pure substance or a mixture. A pure substance is a substance that has the same properties throughout out it. An example of a pure substance would be salt or sugar. Both of the substances are only made of salt or sugar, and the properties of these two substances are the same if you have one or the other in a sample.


On the other hand, a mixture is a combination of two or more substances. For example, if you have salt and pepper inside the same shaker, this is a mixture. This is because separating the salt and the pepper from each other is possible. Separating pure substances is generally not possible physically. However, pure substances can further be broken down into elements and compounds.

Elements are fundamental substances that cannot be broken down into simpler substances. The periodic table contains all known elements. Examples include oxygen, sodium, carbon, etc. Compounds are pure substances that are made of two or more elements. Compound examples include salt, sugar, carbon dioxide, etc.

More on Mixtures

Returning to mixtures, there are two types of mixtures: homogenous and heterogeneous. Homogenous mixtures have the same composition throughout the sample. Examples include milk and sugar water. In both of these examples, the substances that make up the mixture are evenly spread throughout the sample.

Heterogeneous mixtures have different compositions in parts of the sample. A classic example of this is salad dressing. When salad dressing is allowed to sit, it separates clearly into the various substances/homogenous mixture that it is made up of. This is why salad dressing must be shaken before it is enjoyed.

Law of mass conservation

Antoine Lauren de Lavoisier developed the law of mass conservation, which states that in any chemical or physical process, the total mass of everything involved must remain the same. This means that if you start with 5 kg of wood and burn it, there will still be 5kg of matter in a different form. You might see a pile of ashes that weighs less but what happens is that some of the matter was converted to gases and smoke in the burning process. Essentially, matter can be created or destroyed but can only be converted or broken down.


No pun intended, but matter matters. For students, it is important to develop an understanding of concepts related to chemistry. Doing so may help at least some of them prepare for whatever occupation they may have in the future.

close up photo of a diagram with drawing compass

Scientific Measurement

When it comes to measurement in research. There are some rules and concepts a student needs to be aware of that are not difficult to master but can be tricky. Measurement can be conducted at different levels. The two main levels are categorical and continuous.

Categorical measurement involves counting discrete values. An example of something measured at the categorical level is the cellphone brand. A cellphone can be Apple or Samsung, but it cannot be both. In other words, there is no phone out there that is half Samsung and half Apple. Being an Apple or Samsung phone is mutually exclusive, and no phone can have both qualities simultaneously. Therefore, categorical measurement deals with whole numbers, and generally, there are no additional rules to keep in mind.

However, with continuous measurement, things become more complicated. Continuous measurement involves an infinite number of potential values. For example, distance and weight can be measured continuously. A distance can be 1 km or 1.24 km, or 1.234. It all depends on the precision of the measurement tool. The point to remember now is that categorical measurement often has limit values that can be used while continuous has an almost limitless set of values that can be used.


Since the continuous measurement is so limitless, there are several additional concepts that a student needs to mastery. One, the units involved must always be included. At least one reason for this is that it is common to convert units from one to the other. However, with categorical data, you generally will not convert phone units to some other unit.

A second concern is to be aware of the precision and accuracy of your measurement. Precision has to do with how fine the measurement is. For example, you can measure something the to the tenth, the hundredth, the thousandth, etc. As you add decimals, you are improving the precision. Accuracy is how correct the measurement is. If a person’s weight is 80kg, but your measurement is 63.456789kg, this is an example of high precision with low accuracy.

Another important concept when dealing with continuous measurement is understanding how many significant figures are involved. The ideas of significant figures are explored below.

Significant figures

Significant figures are digit that contributes to the precision of a measurement. This term is not related to significance as defined in statistics related to hypothesis testing.

An example of significant figures is as follows. If you have a scale that measures to the thousandth of a kg, you must report measurements to the thousandths of a kg. For example, 2 kg is not how you would report this based on the precision of your tool. Rather, you would report 2.000kg. This implies that the weight is somewhere between 1.995 and 2.004 kg. This is really important if you are conducting measurements in the scientific domain.

There are also several rules in regards to determining the number of significant figures, and they are explained below

  1. All non zeros are significant
    1. Example-123 are all non-zeros and thus are all significant in this case
  2. A zero is significant if it is between two significant numbers
    1. example-1023. The 0 is in between 1 and 2 and is thus significant
  3. Zeros are significant if it is at the end of a number and to the right of the decimal
    1. Example 2.00: Here, the 0’s are to the right of the decimal, which makes them significant

Each of the examples discussed so far has been individual examples. However, what happens when numbers are added or multiplied. The next section covers this in detail

Significant Figures in Math


When adding and subtracting measurements, you must report the measurement results with the less precise measurement.

  • example
  • 115kg – 16.234kg = 98.766kg, but the least precise measurement is 115kg, so we round the answer to 99 kg. This is because our precision is limited to one’s place.


When multiply or dividing measurements report results with the same number of significant figures as the measurement with the fewest significant figures

  • example 1
  • 16.423 m / 101 m = 0.16260396 m

This number is too long. The second number, 101, has three significant figures, so our answer will have 3 significant figures, 0.163m. The zero to the left of the decimal is insignificant and does not count in the total.

  • example 2
  • 8.0 cm * 3.208 = 25.664 cm2 or 26cm2 the first number has two significant digits, so the answer can only have two significant figures, which leads to an answer of 26cm2.

Converting Units

Finally, there are rules for converting units as well. To convert units, you must know the relationship that the two units have. For example, there are 2.54 cms per inch. Often this information is provided for you, and simply apply it. Once the relationship between units is known, it is common to use the factor label method for conversion. Below is an example.

To solve this problem, it is simply a matter of canceling the numerator of one fraction and the denominator of another fraction because, in this example, they are the same. This is shown below.

Essentially there was no calculation involved. Understanding shortcuts like this saves a tremendous amount of time. What is really important is that this idea applies to units as well. Below is an example.

In the example above, we are converting inches to meters. We know that there is 2.54cm in 1 inch. We set up our fractions as shown above. The inches cancel because they are in the numerator of one fraction and the denominator of another. The only unit left is cm. We multiply across and get our answer. Since 24.0cm has the fewest number of significant figures are the answer will also have three significant figures, and that is why its 61.0cm

Scientiifc Nottation

There can be problems with following the rules of significant figures. For example, if you want to convert meters to centimeters. There can be a problem.

The answer should only have three significant figures, but our answer has one significant figure. We need to move two zeros to the right of the decimal.

This is done with scientific notation as shown vbelow.

This simple trick allows us to keep the number of signifcant figures that we need without hhanging the value of then umber.

Below is an example of how to do this with a really small number that is a decimal.


This post explains some of the rules involved with numbers in scientific measurement. These rules are critical in terms of meeting expectations for communicating quantitative results.

a pen over a paper with a bar chart

Creating Bar Graphs in LaTex

LaTex is a highly flexible typesetting program that seems to be capable of almost anything. Here, we will learn how to make bar graphs use this language.

Simple Bar Graph

Below is the code and the bar graph for simple bar graph.

Here is what is happening in the code

  1. Line 1-2 we declare our document class and load the only package we need which is pgfplots.
  2. Line 3-5 we declare the various environments needed
  3. Line 6-12 are all the details we need to create the axis on which our data will be.
  4. Line 7 gives the title of the graph
  5. Line 8 makes the graph a bar graph
  6. Line 9 places the numbers above the bars in the bar graph to make it easier to read. This line also controls how thick the bars are
  7. Line 10 sets the names for the x-axis
  8. Line 11 makes sure each bar only has one name
  9. Line 13 creates the plot. Inside the curly braces you have in parentheses the name of the group and the frquency.
  10. The rest of the code closes the enviornments

Multiple Bars

In the code below we will add several bar graphs to one plot and also add a legend. The code is mostly the same below.

The new information is in lines 12-15. These lines contain the information for the legend. The at argument tells where to put the legend at, anchor tells LaTex how to hold it and the column sep determines the width of the column.


The next important information is in lines 19-23. Here is were we add additional bars. The arguments in side still tell LaTex what color the numbers above the bar should be as well as the color of the bar graphs. The coordinates is were you can hand code the values for the x axis.

The final example will use raw data already available in LaTex to make a bar graph.

Using Data

Below is the code followed by the bar plot

New information is found first in lines 4-9. Here we use a command called “pgfplotstableread” in order to create the table. The table is found in lines 5-9. The first row sets the columns of the table and lines 6-8 is our actual data. In line 9 we give our table a name called “mydata.” It is important to note that this table will not appear in your pdf. Rather this table is just for storing information.If you want to show the table you need to make a table the traditional way.

Line 15 has the names of the groups in our data which were animal names. The next major change is in line 18. Here, we use the “addplot” command to add a table with the x as animal and the y as weight. Next to this information in curly braces is the name of the dateset called mydata.

If you look at the table you can see that we have information on the animals weight and speed but the bar plot only shows weight. In Line 19 there was some code in red which means that it was not compiled. By removing the percent sign we can run all the code and get the following.

The idea of adding to a bar plot remains the same. Just create another instance of the command and run it.


Making bar plots in LaTex is another convenient tool. It allows you to manipulate the data inside LaTex rather then having to pull images from your folder. If your data is stable and not going to change this might be worth while.

NOT, AND & BETWEEN Commands in SQL

This post wuill provide an explanation of how to use the following commands in SQL

  • NOT
  • AND


The NOT command is used to exclude data based on some criteria. In the example, below we will use the NOT command to exclude basketball players who play the power forward or shooting guard position. The code is next followed by the output.

FROM Seasons_Stats

Here is a breakdown of the code.

  1. Line 1 tells SQL to select all columns in the dataset
  2. Line 2 explain which table to use
  3. Line 3 Use the WHERE command first which serves as a filter. Next, the NOT command means to exclude what comes next. The IN command indicates specifically what will be excluded. The information in the parentheses is the categories to remove from the column called “POS”

IF you look at the first ten rows shown above you will see there are no PF or SG in the POS column which is what we wanted.

The example above excluded text data but we can also exclude numerical values as well. In the code below we replace the “Pos” column with the “Year” and we exclude the Years of 1950 and 1051. The code and output are below.

FROM Seasons_Stats
WHERE "Year" NOT IN (1950,1951)

If you look at the “Year” colum you can see it does not start until 1952. In addition. you can clearly see that there are PF and SG in the “Pos” column which used to be what we exlcuded in the previous example.

AND Command

The AND command is used whe n you have multiple criteria for including or excluding information. In the code below we continue to exlcude plauers from 1950 and 1951 but then with the AND command we exclude players whose first name starts with an A. Below is the code and output.

FROM Seasons_Stats
WHERE "Year" NOT IN (1950,1951) AND NOT Player LIKE 'A%'
ORDER BY Player 

What’s new this time is the use of the LIKE command which is used when you are not exactly sure what you are looking for. THis is way the “A” is in sinle quotes followed by the percent sign. THis tells SQL to exclude anything that starts with an A.


The BETWEEN command is when you are searching to include values that fit a certain range. In the code below, we remove the NOT command and include the BETWEEN and the AND command. THis means that we want to include rows that meet our critria rather than exlcude them.

FROM Seasons_Stats

In this code we want any player who is between 41 and 43 years of age. Below is the same output but written with the use of the NOT command

FROM Seasons_Stats

Which is better probably comes down to preference


The commands mentioned here are among some of the basic tools anybody who wants to use SQL needs to know. In the future we will deal with other concepts related to SQL

Views on Societies

This post will look at society and terms related to it as defined from two schools of thought in society. This viewpoints are functionalism and conflict theory.


There are several terms used in the functionalist school for describing societies. For example, collective conscience is the beliefs that constitute a society. An example from the United States would be an emphasis on individualism and capitalism. These beliefs are a part of most Americans’ lives and serve as a common worldview for people from this country.


Social integration is the strength of the ties within a society or a social group. Some societies have stronger ties than others. Many factors can affect social integration, such as the size, similarities of the members, etc. For example, social integration is generally a problem in the US as there is a lot of infighting and discord that is not found in other societies.

There is also a concept called solidarity. Solidarity is a continuum with mechanical solidarity on one side and organic solidarity on the other. Mechanical solidarity has such characteristics as a strong collective conscience, high social integration, and a dedication to doing things the way they are for traditional reasons. This form of solidarity is common in pre-industrial societies where there is a low division of labor.

Organic solidarity is the opposite of mechanical. This means there is a low collective conscience and low social integration. This form of solidarity is common in industrial societies with a high degree of specialized labor. At extreme levels, organic solidarity can be a place for anomie or lawlessness. Anomie involves the rejection of societal norms, which leads to a loss of identity for members of that society.

Norms are often developed and encouraged through habitulization and institutionalization. Habitulization is learning norms through habit development through friends and family. Instititunilization is learning norms through the workplace or school. These norm-forming places are often attacked in societies that have organic solidarity.

Conflict Theory

Conflict theory views society as a place of alienation. Different people define Marx’s alineation in different ways. Some have called it a separation from what one does. Others have said that alineation is a lack of individual development. Karl Marx’s in his Communist Manifesto indicates that alienation can happen in several different ways.

One way alienation happens is through alienation from the product of one’s labor. A second is through the process of one’s labor. THird is from others, and the fourth is from self. All of these various forms of alienation happen in a factory setting for the most part and are found in an industrial society. In other words, alienation is similar to the traits found in an organic solidarity context.

To stop alienation, Marx essentially encourages revolution to overturn the bourgeoisie and their money so that the means of production belong to the people. People who did not agree with this position were accused of having a false consciousness or beliefs, not in their best interest. IN other words, proponents of Conflict theory imply that they know what is best for people.


Different experts choose to look at society using different viewpoints. Functionalist and conflict theorists have different opinions over the structure of societies. Agreeing is not the point but rather understanding how there is more than one way to see anything.

Working With Worksheets in Excel VBA VIDEO

Most of us are use to using the mouse to accomplish various task on the computer or in Excel in particular. However, this is not always a practical way to approach matters when coding. In this video, we will look at using VBA to move between worksheets and accomplish various task. This is really beneficial for people looking to automate some tasks.


Science and Thales

Ionia was a Greek colony in western Turkey founded around 3000 years ago by people looking for land and trading opportunities. This colony of several Greek cities has played a pivotal role in history in several ways. Not only is Ionia famous for rebelling against the Persians, but foundational ideas of science were formed in this place as well. In particular, a man named Thales played a critical part in the development of science.

Role of Greek gods

To understand the influence of Ionia and Thales, it is important to look at the worldview of these people. During this time, religion played a major role in the life of Greeks. The problem with this was not that it wasn’t scientific. The other problem was the erratic and licentious behavior of the Greek gods. Below are just a few examples from Greek mythology demonstrating the vengeful and wild behavior of Greek gods.

  • Zeus could not control his behavior around women and was notorious for his unfaithfulness to his wife, Hera.
  • Hera would often attack the women with whom Zeus was unfaithful by causing the death of the woman involved or persecuting the children of these adulterous relationships such as Heracles.
  • Poseidon, the god of the sea, raped a woman in Athena’s temple. The victim was then turned into the hideous Medusa by Athena for desecrating her temple.
  • Behind the scenes of the Trojan war, the gods were at work, not to mention in the many poems of Homer.

This list could go on for pages. The gods were crazy, to say the least. People tried to appease the gods through sacrifices and works. This was not always successful, and people were always looking for ways to obtain security from this.

Looking Towards Nature

Due to the perceived inconsistent behavior of the Greek gods, people began to look to other ways to understand the world, leading them to seek answers in nature. Nature, in comparison to the Greek gods, was somewhat regular in its behavior.


A major proponent of examining nature over mythology was Thales, a sixth-century Ionian who was one of the first philosopher-scientist. Thales looked at facts and observations to understand the world. He believed in trusting his senses rather than the supernatural explanations of his time. This could almost be viewed as a form of atheism. Thales was a well-traveled individual who was also one of the first to take credit for his ideas by writing his name on them. Thereby demonstrates an example of individualism, which was unusual at that time.

However, Thales was not just talk. He backed his position with several major innovations. For example, Thales accomplished several mathematical/scientific feats. Such as the following.

  • He predicted a solar eclipse in 585 BC. This was important because ancient Greeks viewed solar eclipses as a sign of supernatural abandonment by their unpredictable gods. For Thales to predict such a sign was utterly unbelievable and showed a regularity to nature that the gods never showed.
  • Using what would later become Geometry, Thales determined the height of buildings such as pyramids by measuring their shadows on the ground. This, of course, was revolutionary at the time.
  • Thales also used Geometry to calculate how far a ship was from shore. This was a groundbreaking discovery as such knowledge was important for ships always concerned with running aground.
  • Thales was also one of the first observed static electricity. He didn’t discover it, but he was one of the first to examine it scientifically.

The volume of work by this pre-Socratic philosopher was hard for people to ignore. His work encourages others to look beyond the supernatural to understand the world around them.


The Greek colony of Ionia was a place that contributed to modern scientific thought. In this colony, Thales began to look beyond the gods for answers and instead looked to nature. By doing so, not only did he make several major discoveries, but he also set an influential example of how people should learn about the world.

unhappy black couple sitting on bed after having argument

Leas Levels of Conflict

Speed Leas shares five levels of conflict based on his own research into conflict management. In this post, we will look at these five steps in the context of the classroom.

Problem to Solve

The problem to solve is the lowest level of conflict. The level of conflict is so low that it is often not even perceived as conflict by those involved. The focus is generally on the problem rather than on the people involved. This encourages an objective stance and desire to solve the problem rather than attack each other.

In the classroom, a problem to solve level of conflict can involve minor disagreements between children or the teacher that are worked out quickly with a few moments of talk. For example, if a student takes another student’s personal belongings and returns them when asked, this is a simple problem to solve the conflict.


Disagreement leads to the realization that the parties involved have different opinions about what to do or think. With the threat of real conflict, possible people begin to take strategies to mitigate the risk. For example, they avoid speaking about the problem, or they do not share what they really think about the matter.

In the classroom, disagreements are common. Students may avoid telling a teacher about a problem with another student to avoid conflict. A teacher may ignore poor behavior to avoid conflict with the student or the student’s parents. Teachers may also try to avoid disagreement by not speaking about various problems at the school with each other or with the administration.


At the contest level, the goal is to win without necessarily hurting your opponent physically or emotionally. Things have escalated to proving that you are right at the expense of the other person. Therefore, things are still often intellectual in nature rather than raw emotion. Emotions are invited, such as fear and trust have broken down, yet things are out of control. Passive aggressiveness goes up; body language gets defensive, the tone of voice changes, and more.

In the classroom, students can argue over many things considered at the contest level of conflict. Examples can include who gets to use a particular item, who was first, who won the game, who cheated, etc. It can also involve demands for apologies for behavior.


Fighting involves hurting the other person without being hurt. It is about being right at the expense of the other person being wrong. Here things can start to get messy and even dangerous in some situations. Both parties see the other’s actions as aggressive. The goal is to get the other person to give up so that one side can declare victory.

This is where the classic playground fight comes in as an example. Both sides are posturing, hoping that the other side gives up so that it never actually becomes physical. There is no discussion, there is no trust, and the goal no is victory at the expense of the other person. It is now a zero-sum game.

Intractable Conflict

At this final stage, the result is mutual destruction of the relationship and people involved. The destruction does not have to be physical; it can also be emotional, financial, reputation, etc. The people involve separate after a bitter conflict with a long road towards reconciliation. Even with separation, passive-aggressive swipes may continue as those found in soap operas.

This level of conflict is found in high school and beyond. At this level, conflicts harden into wars of attritions. Students also begin to master the art of manipulating each other for political gain. Rumors, gossip, and jealousy, all things foreign to small children, begin to manifest among teenagers. This naturally implies that this level of conflict happens among teachers as well. Indeed, teachers frequently argue amongst each other and fight over resources. There can even be wars between departments over resources that can be highly toxic.


The ultimate goal of dealing with conflict is generally to keep it at level one or bring it back to level one. This means dealing with problems when they are small and harmless or letting them grow until it destroys a relationship. Strategies that can help deal with conflict include communication, finding mediators, and negotiating. Conflict is a part of life, and people must learn to deal with it rather than ignore it.

pie graph illustration

Visualizations with Altair

We are going to take a look at Altair which is a data visulization library for Python. What is unique abiut Altair compared to other packages experienced on this blog is that it allows for interactions.


The interactions can take place inside jupyter or they can be exported and loaded onto websites as we shall see. In the past, making interactions for website was often tught using a jacascript library such as d3.js. D3.js works but is cumbersome to work with for the avaerage non-coder. Altair solves this problem as Python is often seen as easier to work with compared to javascript.

Installing Altair

If Altair is not already install on your computer you can do so with the following code

pip install altair vega_datasets


conda install -c conda-forge altair vega_datasets

Which one of the lines above you use will depend on the type of Python installation you have.


We are going to make some simple visualizations using the “Duncan” dataset from the pydataset library using Altair. If you do not have pydataset install on your ocmputer you can use the code listed above to install it. Simple replace “altair vega_datasets” with “pydataset.” Below is the initial code followed by the output

import pandas as pd
from pydataset import data

In the code above, we load pandas and import “data” from the “pydataset” library. Next, we load the “Duncan” dataset as the object “df”. Lastly, we use the .head() function to take a look at the dataset. You can see in the imagine above what variables are available.

Our first visualization is a simple bar graph. The code is below followed by the visualization.

import altair as alt
x= "type",
y = "prestige"

In the code above we did the following,

  1. Line one loads the altair library.
  2. Line 2 uses several functions together to make the bar graph. .Chart(df) loads the data for the plot. .mark_bar() assigns the geomtric shape for the plot which in this case is bars. Lastly, the .encode() function contains the information for the variables that will be assigned to the x and y axes. In this case we are looking at job type and prestige.

The three dots in the upper right provide options for saving or editing the plot. We will learn more about saving plots later. In addition, Altair follows the grammar of graphics for creating plots. This has been discussed in another post but a summary of the components are below.

  • Data
  • Aesthetics
  • Scale.
  • Statistical transformation
  • Geometric object
  • Facets
  • Coordinate system

We will not deal with all of these but we have dealt with the following

  • Data as .Chart()
  • Aesthetics and Geometric object as .mark_bar()
  • coordinate system as .encode()

In our second example, we will make a scatterplot. The code and output are below.

x= "education",
y = "prestige"

The code is mostly the same. We simple use .mark_circle() as to indicate the type of geometric object. For .encode() we made sure to use two continuous variables.

In the next plot, we add a categorical variable to the scatterplot by manipulating the color.

    x= "education",
    y = "prestige",

The only change is the addition of the “color”argument which is set to the categorical vareiable of “type.”

It is also possible to use bubbles to indicate size. In the plot below we can add the income varibale to the plot using bubbles.

    x= "education",
    y = "prestige",

The latest argument that was added was the “size” argument which was used to map income to the plot.

You can also facet data by piping. The code below makes two plots and saving them as objects. Then you print both by typing the name of the objects while separated by the pipe symbol (|) which you can find above the enter key on your keyboard. Below you will find two different plots created through this piping process.

    x= "education",
    y = "prestige",
    x= "income",
    y = "prestige",
educationPlot | incomePlot

With this code you can make multiple plots. Simply keep adding pipes to make more plots.

Interaction and Saving Plots

It is also possible to move plots interactive. In the code below we add the command called tool tip. This allows us to add an additional variable called “income” to the chart. When the mouse hoovers over a data-point the income will display.

However, since we are in a browser right now this will not work unless w save the chart as an html file. The last line of code saves the plot as an html file and renders it using svg. We also remove the three dots in the upper left corner by adding the ‘actions’:False. Below is the code and the plot once the html was loaded to this blog.

    x= "education",
    y = "prestige",

I’ve made a lot of visuals in the past and never has it been this simple


Altair is another tool for visualizations. This may be the easiest way to make complex and interactive charts that I have seen. As such, this is a great way to achieve goals if visualizing data is something that needs to be done.

String Functions and Excel VBA

This post will provide several examples of using string functions in the Excel VBA developer. There are a large number of string functions that are available in Excel but we are only going to look at the following…

  • InStr
  • UCase
  • LCase
  • Mid
  • Join

The first example will use most of the functions listed above. Below is the code for the subroutine we are creating.

Sub modString()
Dim text As String, text2 As String
text = "educationalresearchtechniques"
MsgBox InStr(text, "cat")
MsgBox InStr(10, text, "i")
MsgBox UCase(text)
MsgBox LCase(text2)
End Sub

This code is rather straightforward. We are manipulating the phrase “educationalresearchtechniques” or the same phrase in all caps.

The InStr function takes the text variable and searches it for the string “cat.” The output gives the position at which you can find the phrase “cat”. Below is the output from the message box.

The string “cat” begins in the fourth position of “educationalresearchtechniques” which you can see for yourself.


The second InStr function tells VBA to skip the first 10 spaces in the string and then look for the letter “i”. This was done because the letter i appears twice in the string so this allows you to find the second appearance of the letter “i”. Below is the output.

The second “i” appears in the 25th position of the string.

The last two functions are similar. The UCase function makes all letters capitals and the LCase function makes all letters lower case. Below we have both outputs shown.

The output to the left uses the variable “text” while the output to the right used the variable “text2.”


The coding for the array is more complex. Our goal is to remove the spaces when we join the text in an array. Below is the first part of the code

Option Base 1
Sub joinText()
Dim word(4) As String, combineMsg As String, msg As String
word(1) = "z"
word(2) = "ys"
word(3) = "x"
word(4) = "w"
combineMsg = Join(word)

In the code below we declare several variables that we will need and we add the content to the array we created called “word.” This array is a 1 x 4 array. Each time we type word(x) we are putting the string after the equal sign in that position. A the bottom of the code we use a Join function to combine all the strings in the array into one string. The problem is that this string has spaces between the letters. To fix this, we will use the for loop and if-then statement below.

For i = 1 To Len(combineMsg)
    If Not Mid(combineMsg, i, 1) = " " Then
         msg = msg + Mid(combineMsg, i, 1)
    End If
Next i
MsgBox (msg)
End Sub

This for loop goes from i to the length of the combineMsg string. In the next line, we use the mid function to tell VBA to start looking at whatever ith position we are at and to take one character from the string. If the character is not a space ” ” then we will add it to the new variable called msg. If it is a space we ignore it. Finally, after this has looped several times we exit and print the new string in a message box. The output is below.

What you see above is the locals window from the VBA developer. You can see that the combineMsg variable has spaces between the input from the word array. However, this is fixed when you look at the msg variable in the next line. Below is the output from the Message Box.


String functions are another tool that has many applications in Excel VBA. We only touch on some basic ideas here but there is so much more that can be done.

Defining Groups in the Classroom

The term group is a word that is used all the time in day-to-day conversation. In this post, we will look at what groups are along with various terms related to them.

Terms Related to Groups

A group involves at least two people who interact in some sort of meaningful way. Examples of a group can include a family, colleagues in a department, neighbors, etc. Keeping in mind that just because people are in the same place does not imply they are members of a group. For example, if people are at a mall, it is doubtful that they are members of one group. Rather, this is called an aggregate in that they are in the same place but not necessarily “together.”


Another term is “category.” A category is a group of people who share characteristics but do not interact with each other. An example would be the freshman class at a high school. They are all about the same age, but they probably do not know each other or work together.

Primary & Secondary Groups

Groups can also be defined in terms of primary and secondary, with the difference being in terms of the intimacy of the members’ relationships. A primary group is usually small and has a high degree of closeness and intimacy, such as in a family. A primary group might be a clique of friends that is especially common at the high school level in the classroom.

A secondary group is larger and not as intimate. The function of a secondary group is primarily instrumental or in terms of getting something done or achieved. Many groups formed at work are secondary in nature. In school, a secondary group might be a group formed to complete assignments. Generally, these students do not socialize or work together, but for the sake of the assignment, they do work together.

However, these definitions are superficial, and it is common for a group to perhaps serve in both roles and for people to move back and forth between these two groups over time. Another point is that if there are problems with these groups, there could be problems with the teacher’s performance and /or behavior.

In & Out Groups

Groups also are highly aware of who is in the group and not in the group. The in-group are members of the same group, while the out-group is essentially everyone else. At times this can be positive or negative. For example, members of a sports team may have negative attitudes towards other teams. Or, members of one race may have negative attitudes towards other races. However, teachers may have a sense of duty to help others as a member of the teaching profession.

Students are highly sensitive to including and excluding people at times. There is also pressure to be a part of some sort of group since out-group members can be bullied by members of in-groups. Sometimes the out-group members almost become a sort of “other,” which can be detrimental for both groups in terms of behavior.

A reference group is a group that a person compares themselves to. All ages, from teenager to adult, compare themselves with peers of the same age. This comparison helps people to determine what is and what is not acceptable behavior.


Groups are a part of everyone’s life. We all have to work and live in groups and deal with the challenges of dealing with people. As such, the intro to groups here provides some insights into the underlying characteristics of groups.

Using and Arrays and Functions in Excel VBA

In this post, we are going to look at using arrays and functions together. Our goal is to create a function that can divide the numbers in an array and count how many have a remainder.

Declare Function and Variables

First, we need to declare our function and variables. This is done in the code below.

Function remainderCount(rng as Range, n as integer) as Integer
Dim i as Integer, j as Integer
Dim nr As Integer, nc As Integer, c As Integer
nr=  rng.Rows.Count
nc = rng.Columns.Count

The name of our function is remainderCount. It takes to arguments. Rng is for the array and n is for the divisor. In the next to lines, we declare variables for the following.

  • i for row
  • j for column
  • nr for number of rows
  • nc for number of columns
  • c for the number of numbers that have a remainder
  • The last to lines are for counting the number of rows and columns

For Loop

Next, we need to create our nested for loop. This code has been used several times on this blog so we will not explain much here.

For i = 1 To nr
	For j = 1 to nc
		If rng.Cells(i,j) Mod n >= 1 Then
			c = c+1
		End If
	Next J
Next i
remainderOne = c
End Function

The for loop goes first across columns and then down to the next row. In each cell, it checks to see that if the number in that cell is divided by our n if there is a remainder or not. If so then the c variable increase by 1. After this, the output of the function is set to whatever value c is,

Below is the full code followed by what this looks like in Excel.

Function remainderCount(rng as Range, n as integer) as Integer
Dim i as Integer, j as Integer
Dim nr As Integer, nc As Integer, c As Integer
nr=  rng.Rows.Count
nc = rng.Columns.Count
For i = 1 To nr
	For j = 1 to nc
		If rng.Cells(i,j) Mod n = 1 Then
			c = c+1
		End If
	Next J
Next i
remainderCount = c
End Function

Below is the output

The answer is 4. This is because there are six numbers in the array. Two of the numbers are divisible by 4 (12 & 24) but the other four numbers are not (14, 18,19,27). The numbers that are not divisible by 4 make up the answer.


This is one of the more practical ways that you can employ knowledge of arrays with functions. Of course, there is an infinite number of ways to use these tools. This means that practice is the best way to learn how to apply these tools.

DNA, Proteins, & Origins

DNA and proteins are critical building blocks to life. However, the origins of these important components are not clear. IN this post, we will explore some of the challenges to the origins of DNA and proteins.


A major problem that scientists wrestle with as they try to explain the origins of man as to do with DNA. DNA is the basic blueprint that allows for the various life that is found on this earth. DNA serves many purposes but among them includes giving instructions to cells for protein production and passing this information to the next generation.


One of the main obstacles facing evolution is that DNA is necessary for the formation of proteins. However, proteins are needed for copying and translating DNA into proteins. This implies that both DNA and proteins had to evolve at the same which does not currently seem to make sense. How could two key components of life evolve at the same time and also need or know that they must work together?

RNA & Proteins

One suggestion has been that RNA evolves before DNA. However, in its own way, RNA is just as complex as DNA and it is hard to find evidence that supports RNA or DNA evolving spontaneously. So far there is no evidence of even one DNA or RNA molecule evolving from lifeless chemicals to make one protein. Nor is there any evidence of proteins forming naturally.

Once DNA is here things do not get any easier. The order of the DNA letters used in the genetic code must be in the right order. IN addition to the challenge of sequencing, there must also be sequences of code around a sequence that controls the production of the sequence. For example, nobody wants their genes constantly telling their body to control. If such a thing happened it can and has led to health dangers for people. The odds of all this happening even over billions of years is essentially zero.

Proteins are made of amino acids and this presents another problem. There has been speculation that life evolved in the ocean billions of years ago. However, it is difficult for amino acids to form in the water to make proteins. Proteins are absolutely essential for life and if the amino acids cannot form or are hindered it could have major ramifications. What this implies is that there are major questions that need to be answered in order to validate the theory of evolution.


There are many unanswered questions concerning DNA and the origins of life. With time perhaps an answer will be found. Right now, there is only speculation.

Arrays and Subroutines in Excel VBA


In this post, we are going to go over a simple example that will demonstrate how subroutine and arrays can work together to achieve a specific purpose. What we want to do is for our subroutine to be able to take a number from the user and determine if when we divide each number in the array y the user number if the answer has a remainder of 1 or greater.

Below is the array as it would be found in Excel

Notice how the cells are selected. This is necessary for the code that we will use.

Next, we need to set up our code. We will begin by declaring our subroutine and variables as shown below.

Option Base 1
Sub remainderOne()
Dim i as Integer, j as Integer, n as Integer
Dim nr As Integer, nc As Integer, c As Integer
nr=  Selection.Rows.Count
nc = Selection.Columns.Count
n = InputBox("Enter a number")

The variables above will be used to store data we need to achieve our goal. I and j are for the rows and columns, the n variable will store data from the user, nr and nc are for counting the rows and columns, lastly, c is a variable that will count how many times our criteria is met.

We now need to include the nested for loop with the output

For i = 1 To nr
	For j = 1 to nc
		If Selection.Cells(i,j) Mod n >= 1 Then
			c = c+1
		End If
	Next J
Next i
MsgBox("There were " & c & " numbers with remainder of one when divivded by " & n & "."
End Sub

The nested for loop goes through each row and column seeing if the number inputted by the user results in a remainder of 1 or greater. The details of for loops have been explained in a prior post.

The code was explained in parts but here is how it should look in the VBA developer

Option Base 1
Sub remainderOne()
Dim i as Integer, j as Integer, n as Integer
Dim nr As Integer, nc As Integer, c As Integer
nr=  Selection.Rows.Count
nc = Selection.Columns.Count
n = InputBox("Enter a number")
For i = 1 To nr
	For j = 1 to nc
		If Selection.Cells(i,j) Mod n >= 1 Then
			c = c+1
		End If
	Next J
Next i
MsgBox("There were " & c & " numbers with remainder of one when divivded by " & n & "."
End Sub


We will now run the code.

The textbox asks for a number and we put the number. Below are the results

The message box tells you there are two numbers that have a remainder of 1 or more. Doing some basic math you can see that those two numbers are 41 and 14.


With a little bit of work, it is possible to use arrays with subroutines to do powerful things inside VBA. This example is one of many of how this can be done.

Importing and Exporting Arrays in VBA

There are times when you need to move data between your worksheet and VBA and vice versa. This post will explain how to move data in either direction.


In this context, importing will mean moving data from the worksheet to the VBA developer. We are going to move the data below into the developer

Below is the code to do this

Option Base 1
Sub bringArray()
Dim A() As Variant
A = Selection
End Sub

The code does the following

  • Line one is an option to set the base to 1. This makes sure that VBA does not add an additional column to the array.
  • Line 2 is where we begin the subroutine
  • Line 3 dim or create our array as a variant. A variant is a highly flexible data type in VBA.
  • Line 4 tells VBA to take the data from the highlighted cells in the worksheet and save them in A.

Below is the output

THe imaage above is sharing with you the data that is now inside the developer. The numbers in the value column are the same as the numbers found in the worksheet.

The code below is slightly different in that it can be used when you know exactly what rnage of data you want to take from the worksheet.

Option Base 1
Sub bringArray()
Dim A() As Variant
A = Range("A1:B2")
MsgBox A(1,1)
End Sub

The only difference is in line 4 where the range function is used rather than the selection one. Since the output is the same as the previous example it will not be displayed here.


For export we are taking data from the VBA developer and placing it in an Excel worksheet. This code will involve the use of nest for loops. Below is the code.

Sub sendArray()
Dim i as Integer, j As Integer
Dim A(2,2) As Integer
For i = 1 To 2
	For j = 1 To 2
		Range("A1:B2").Cells(i,j) = A(i,j)
	Next J
Next i
End Sub

Here is what the code does

  • Line 1 declares the subroutine
  • Line 2-3 declare the variable and array we need. The array is set to 2 x 2 because we know how big it will be .
  • Line 4-9 are the nested for loop. The outer for loop is for the rows and the inner is for the columns. For the array we are taking the value of the row and multiplying it by 3 before subtracting whatever the value of j is. For example
  • i =1 and j = 1 then
  • (3*1)-1 = 2 [This is the output for row 1 column 1
  • The range function is used to know where to place the results

Below is the output for this code

You can see that the results to the left are duplicating what is found in the right indicating that the code is a success.

The variation below allows you to create the array in the developer place it in the worksheet and also copy it to a cell range you select. Below is the code.

Sub sendArray()
Dim i as Integer, j As Integer
Dim A(2,2) As Integer
For i = 1 To 2
	For j = 1 To 2
		Range("A1:B2").Cells(i,j) = A(i,j)
	Next J
Next i
End Sub

What is new is in the second to last line. Here we set selection to A which will be the new location for our output. Below are the results.

You can see the second array that is copied below


Importing and exporting arrays is sometimes necessary when developing VBA code. The examples providing here give insights into how to do this.

black twist pen on notebook

Developing Conceptual and Operational Definitions for Research

Defining terms is one of the first things required when writing a research paper. However, it is also one of the hardest things to do as we often know what we want to study intuitively rather than literally. This post will provide guidance in the following

  • Developing conceptual definitions
  • Determining operational definitions
  • Understanding the measurement model

Each of the ideas above is fundamental to developing coherent research papers.


A concept is a mental construct or a tool used to understand the world around us. An example of a concept would be intelligence, humor, motivation, desire. These terms have meaning, but they cannot be seen or observed directly. You cannot pick up intelligence, buy humor, or weigh either of these. However, you can tell when someone is intelligent or has a sense of humor.


This is because constructs are observed indirectly through behaviors, which provide evidence of the construct. For example, someone demonstrates intelligence through their academic success, how they speak, etc. A person can demonstrate humor by making others laugh through what they say. Concepts represent things around us that we want to study as researchers.

Defining Concepts

To define a concept for the purpose of research requires the following three things

  • A manner in which to measure the concept indirectly
  • A unit of analysis
  • Some variation among the unit of analysis

The criteria listed above is essentially a definition of a conceptual definition. Below is an example of a conceptual definition of academic dishonesty

Below is a breakdown of this definition

Academic dishonesty is the extent to which individuals exhibit a disregard towards educational norms of scholarly integrity.

  • Measurement: exhibit a disregard towards educational norms of scholarly integrity.
  • Unit of analysis: individual
  • Variation: Extent to which

It becomes much easier to shape a research study with these three components.

Conceptual Definition Template

There is also a template readily available in books and the internet to generate a conceptual definition. Below is one example.

The concept of _____________ is defined as the extent to which

_________________________ exhibit the characteristic(s) of _______________.

Here is a revised version of our conceptual defintion of academic dishonesty

The concept of academic dishonesty is defined as the ewxtent to whcih invidivudals exhibit the characteristic of  disregard towards educational norms of scholarly integrity.

The same three components are there. The wording is mostly the same, but having a template such as this can really save them time in formulating a study. It also helps make things clearer for them as they go forward with a project.

Operational Definition

Once a concept has been defined, it must next be operationalized. The operational definition indicates how a concept will be measured quantitatively. This means that a researcher must specify at least one metric. Below is an example using academic dishonesty again.

Conceptual Definition: Academic dishonesty is the extent to which an individual exhibits a disregard towards educational norms of scholarly integrity.

Operational Definition: Survey Items

  1. It is okay to cheat
  2. It is okay to turn in someone else’s work as my own

In the example above, academic dishonesty was operationalized using survey items. In other words, we will measure people’s opinions about academic dishonesty by having them respond to survey items.

Measurement error happens when there is a disconnect between the conceptual definition and the measurement method. It can be hard to detect this, so students need to be careful when developing a study.

Measurement Models

A concept is not measured directly, as has already been mentioned. This means that when it is time to analyze our data, our contract is a latent or unobserved variable. The items on the survey are observed because people gave us this information directly. This means that the survey items are observed variables.

The measurement model links the latent variables with the observed variables statistically. A strong measurement model indicates that the observed variables correlate with the underlying latent variable or construct.

For example, academic dishonesty has been the latent variable example of this entire post. The survey items “it’s okay to cheat” and “it’s okay to turn in someon else’s work as my own” are observed variables. Using statistical tools, we can check if these observed variables are associated with our concept of academic dishonesty.


Defining concepts is one of the more challenging aspects of conducting research. It requires a researcher to know what they are trying to study and how to measure it. For students, this is challenging because articulating ideas in this manner is often not done in everyday life.

Working with Arrays in Excel VBA VIDEO

Arrays are the selection of multiple columns and rows in Excel. In this video, we will learn how to manipulate an array with simple multiplication. Learning about this in isolation is not highly applicable. However, what is learned here is important for more practical actions when using VBA.