text:
# Estimating the Distributional Impacts of the COVID-19 Pandemic and the Remedial Tax and Benefit Policies in Indonesia

1. College of Graduate Studies, University of South Africa, South Africa
2. Southern African Social Policy Research Insights, United Kingdom
3. Fiscal Policy Agency, Indonesia
4. UNICEF Indonesia, Indonesia
5. Department of Economics, Indonesia
Research article
Cite this article as: G. Wright, M. Noble, H. Barnes, A. Moechtar, D. McLennan, A. Anshory Yusuf, K. Gasior, R. Muyanto; 2021; Estimating the Distributional Impacts of the COVID-19 Pandemic and the Remedial Tax and Benefit Policies in Indonesia; International Journal of Microsimulation; 14(2); 50-80. doi: 10.34196/ijm.00236

## Abstract

The Government of Indonesia acted quickly to protect people from the financial impact of the COVID-19 pandemic and associated lockdown measures in 2020. Using a static tax and microsimulation model for Indonesia with adjusted datasets to reflect the economic shock throughout 2020, we explore how the pandemic affected people’s earnings in Indonesia, the extent to which the automatic stabilisers that were already built into the tax and benefit system cushioned the economic shock, and how the augmented or new benefit policies served to further cushion the shock. We estimate that in 2020 the additional policies meant that poverty rose from 6.8 percent to a maximum of 8.3 percent rather than to 10.7 percent if they had not been introduced. We discuss reasons why the official poverty estimates for 2020 are higher than those generated in this study.

## 1. Introduction

During 2020, the COVID-19 pandemic wreaked havoc across the world, causing shockwaves that have impacted on many people’s lives and financial security. In the absence of any known cures or preventative vaccines, governments quickly implemented policies to minimize its impact. In particular, public health policies were rolled out which focused on containing the spread of the virus but these measures in turn had a detrimental impact on many economies, at least in the short-run. In addition, tax and benefit policies were often either augmented or introduced from scratch, in order to mitigate the financial impact of the pandemic and associated containment measures on people’s lives. The speed with which initiatives were introduced has been unprecedented: for example, the United Nations Special Rapporteur on extreme poverty and human rights observed that 1,407 new social protection measures had been adopted by 208 countries and territories by September 2020 (United Nations, 2020).

In this paper we explore how the COVID-19 pandemic has impacted on people’s earnings in Indonesia, the extent to which the automatic stabilisers that were already built into the tax and benefit system cushioned the economic shock, and how the augmented or new tax and benefit policies that were introduced because of the pandemic served to further cushion the shock.

We provide a distributional analysis on household circumstances throughout 2020, by combining the tax-benefit microsimulation model INDOMODwith a novel approach to estimate the COVID-related shock on the labour market (Barnes et al., 2019). This allows us to analyse income changes for each calendar month of 2020 by taking into account the combined effect of changes in earnings and the effect of existing and newly introduced COVID-related tax-benefit policies as well as their changing rules over the year.

Similar work has been or is still being undertaken using the EUROMOD microsimulation software for other countries such as Ecuador (Jara et al., 2021); Ireland (Beirne et al., 2020); Italy (Figari and Fiorio, 2020); the United Kingdom (Brewer and Tasseva, 2020; Bronka et al., 2020); six countries across Africa – Ghana, Mozambique, South Africa, Tanzania, Uganda and Zambia (Lastunen et al., 2021, forthcoming); and Vietnam (forthcoming). This paper is inspired methodologically by these earlier studies but is unique in its focus on monthly changes in household incomes as a result of policy changes.

The contribution of this paper is fivefold. First, we provide a methodology for nowcasting quarterly income shocks using a technique that draws from anonymized phone data on people’s mobility patterns to estimate the COVID-related shock on economic activity (Carlitz and Makhura, 2020; Sampi and Jooste, 2020; Yusuf et al., 2020). Second, the analysis is based on very timely data derived from the National Socio-Economic Survey Indonesia (SUSENAS) 2019 (Badan Pusat Statistik (BPS), 2019), including individual level income data from the survey which is not usually available for external research purposes. This provides an opportunity for an in-depth analysis of income changes along the distribution and for different population sub-groups. Third and most importantly, the paper focuses on the role of the tax-benefit system in cushioning the consequences of the pandemic. Fourth, this is possible due to the state-of-the-art microsimulation model INDOMOD which allows us to monitor the impact of policies in a timely manner and to decompose the role of existing tax-benefit policies versus the effectiveness of emergency policies. Fifth, modelling the different tax and benefit policies that were in place for each month in the calendar year of 2020, it is possible to unpick in a very detailed way the role that the tax and benefit system has played in mitigating the impact of the pandemic on poverty and inequality. This shows the extent to which the social policy response during the year was successful and also provides pointers for further support to avoid more severe long-term effects on incomes after the pandemic.

The analysis presented in this paper shows that consumption fell across the deciles in quarters 2, 3 and 4 when compared with quarter 1 of 2020. Nevertheless, the policies that were introduced protected millions of people from a greater financial shock than would otherwise have been the case. For example, for households containing one or more children, poverty would have risen to a high of 11.99 percent in May 2020 without the COVID-19 policies, but instead rose to 9.49 percent, and for households containing one or more elderly people, poverty would have risen to a high of 14.25 percent without the COVID-19 policies, but instead rose to 11.40 percent.

In terms of the structure of the rest of this paper, Section 2 provides an overview of the COVID-19 situation in Indonesia and the policy response to the pandemic. Section 3 introduces the INDOMOD microsimulation model and sets out the tax and benefit policies that are simulated in the model, as well as providing baseline validation statistics for 2019. Section 4 describes the methodological approach used for modelling the new COVID policies in each month of 2020, explains how INDOMOD’s dataset was adjusted to take into account the shocks at different timepoints in the year, and discusses key concepts and assumptions. Our analysis is presented in three sections: first, the impact of the shock with no additional tax and benefits (Section 5); second, the impact of the shock on earnings (Section 6), and third, the combined impact of the shock and the new taxes and benefits (Section 7). This is followed in Section 8 by a discussion about the findings and their implications.

## 2. COVID-19 Situation in Indonesia and Policy Response

COVID-19 cases were first reported in Indonesia in March 2020and as of 8th January 2021 there had been 797,723 confirmed cases of COVID-19 and 23,520 deaths (Suryahadi et al., 2020; World Health Organisation, 2021).

Social distancing to contain the spread of the virus was introduced in Indonesia in March 2020. Using Google mobility data, Yusuf et al. (2020) found that average mobility in Indonesia had fallen by 40 percent by the end of March 2020 compared to the first two weeks of that month; by treating mobility reduction as a proxy for the shock to the economy that is associated with rising levels of poverty and inequality, they conducted analysis for the period mid-February 2020 to mid-July 2020 and demonstrated that poor people had been disproportionately affected by the pandemic.

Others have also signalled their concern about the impact of the pandemic on poverty in Indonesia. For example, Suryahadi et al. (2020) estimated that between 1.3 and 19.7 million people could fall below the poverty line based on their estimated best and worst-case scenarios of the economic impact of the pandemic by the end of 2020. Aulia et al. (2020) conducted in-house simulations at the National Development Planning Agency (BAPPENAS) and estimated that at least 3.6 million additional people would become poor. Most recently a study by UNICEF, PROSPERA, UNDP and SMERU (2021) found that households across all income groups experienced a similar percentage fall in income, with almost a quarter of households also reporting a rise in outgoings on essentials. Furthermore, they found that half of all households had no savings, and that over a quarter of households had reported having to pawn possessions to help cover their costs. The results presented in this paper complement the earlier studies by providing detailed analysis that takes into account changes made to the policies on a month-by-month basis.

Concerns about rising levels of poverty and especially child poverty are of course not unique to Indonesia (e.g. Sumner et al., 2020; Global Coalition to End Child Poverty, 2020), but Indonesia’s size, both in terms of geographical extent and in terms of its population, make it particularly imperative to ensure that the impact of the pandemic can be monitored and mitigated.

Indonesia has a sophisticated tax and benefit system which was well established prior to the pandemic and so the country was able immediately to build on these frameworks (e.g. IPC-IG and UNICEF, 2019; Jellema et al., 2017; TNP2K, 2018; World Bank, 2017). Although Indonesia’s social spending prior to the pandemic was regarded as low compared to other middle-income countries, it nevertheless did make an important dent on inequality (Kim et al., 2020). For example, the main social protection arrangements in 2016 have been shown to have reduced inequality by 3.7 percent overall, and by 5.7 percent in rural areas and to be poverty-reducing (Yusuf, 2018). Jellema et al. (2017) found that Indonesia’s fiscal policy reduces poverty and inequality very slightly overall (though they excluded personal income tax from the analysis).

The Government of Indonesia introduced a range of measures throughout 2020 to mitigate the impact of the pandemic, including health and social protection policies, and support for Micro, Small and Medium Enterprises (MSMEs), businesses, and local government. Many of the new policies relating to social protection were incorporated into INDOMOD; they are described in Section 4.

## 3. INDOMOD

INDOMOD is a static tax-benefit microsimulation model for Indonesia which has been developed by SASPRI for use by Government in collaboration with UNICEF Indonesia (Barnes et al., 2019). It is run using the EUROMOD microsimulation software EM Version 3.1.8 (Sutherland and Figari, 2013; University of Essex, 2019). The version of the model that is used in this paper is INDOMOD V2.1 which is underpinned by a dataset that was derived from the nationally representative National Socio-Economic Survey/ Survei Sosial Ekonomi Nasional (SUSENAS) for March 2019 (Badan Pusat Statistik (BPS), 2019), as well as modifications of that dataset which are described in Section 4.

The 2019 SUSENAS survey contains detailed information, including data on income and expenditure, from over 315,000 households and more than 1.2 million individuals. The final post-cleaning response rate was very high at 98.65 percent. The survey captures detailed information about households and individuals, the most relevant of which for INDOMOD comprise information on demographics, education, labour force participation, functional impediments, health insurance, social protection, household expenditure (food and non-food), income from wage/salary, business income, property income, non-consumption income and expenditure, and financial transactions. The SUSENAS 2019 data was found to be of very good quality in terms of levels of completion, consistency and plausibility.

The SUSENAS data was transformed into a dataset in the correct format for INDOMOD (the ‘input dataset’ in EUROMOD terminology, as distinct from the model’s ‘output dataset’ which additionally contains simulated variables). Each of the variables in INDOMOD’s input dataset was constructed and named to accord with the requirements of the EUROMOD software. See Barnes et al., 2021 for a detailed discussion of the construction of the input dataset and internal validation checks carried out as part of the data preparation.

The main tax and benefit policies that are modelled in INDOMOD for the 2019 policy year comprise four benefits, six policies relating to social insurance contributions and two central taxes. 1 These policies are summarised in Table 1 and elaborated in more detail in Barnes et al., 2021.

Table 1

With regard to the benefits, SUSENAS does not contain sufficient intra-household relationship data to enable families within a household to be identified and so, as an approximation, households were used rather than families in INDOMOD. A proxy means test is used to rank families in terms of predicted expenditure within the Unified Database (Basis Data Terpadu, BDT), but SUSENAS does not record whether a family is listed in this database.2 Therefore, as an approximation of this step, the SUSENAS derived variable kapita (average monthly expenditure per capita) was used to identify the poorest households. See Annex 1 for further details about how low income families were identified in SUSENAS. Conditionalities are not simulated in INDOMOD and so it is assumed that eligible beneficiaries are compliant.

Before assessing the situation in 2020, it is important to understand how closely INDOMOD simulates the taxes and benefits when compared with external validation data. Annex 2 provides results for 2019. INDOMOD simulates 16.5 million tax payers, compared to 12.6 million recorded tax payers (Table B1); with IDR 114.6T of PPP tax, compared to IDR 148.9T of recorded PPP tax receipt for labour income (Table B2). INDOMOD simulates 39 percent of recorded domestic VAT in 2019. Simulated expenditure on the main benefits is as follows: INDOMOD simulates 114 percent of reported expenditure on PKH; 96 percent of reported expenditure on PIP; and 73 percent of reported expenditure on BPNT.3

Differences between the simulated results and macro-validation can be for a number of reasons. Regarding tax and benefit payment and receipt, INDOMOD applies the ‘de jure’ position, whereby everyone in the underpinning dataset who is identified in the model as being eligible for benefits receives them, and there is full compliance in the payment of taxes and social insurance contributions. For this reason alone, the poverty rates generated using the simulated results in the following analysis will differ from those published by BPS for 2020 – the differences are summarised and discussed in the final section.

Any comparison to reported results from administrative sources needs to take into account the possibility of inclusion errors (recipients on the system who are ineligible) or exclusion errors (eligible individuals who are not registered on the system).

In addition, the accuracy of the simulations depends on the accuracy of the underpinning dataset, in terms of the extent to which it is nationally representative, the accuracy of the demographic and income and expenditure data, and the precision with which the tax or benefit policies could be modelled. Assumptions made when constructing the variables in the input dataset are described in Barnes et al., 2021, along with assumptions relating to the implementation of the 2019 policy rules, many of which are relevant to the analysis presented in this paper.

## 4. Method

The methodology used for the analysis undertaken in this paper has three main components: first, the policies introduced in response to the pandemic were incorporated into INDOMOD; second, the shock to household incomes as a result of the pandemic had to be estimated; and third, the input dataset underpinning INDOMOD had to be modified to reflect the shock. These steps are described in the following sub-sections, and the key underlying assumptions of the approach are discussed.

### 4.1. Modelling the tax and benefit policies for 2020

In INDOMOD and other models that use the EUROMOD software, it is customary for the tax-benefit rules for a particular policy year to be modelled in a single ‘system’ (in EUROMOD terminology). For INDOMOD the usual timepoint is March of each year, to match the timepoint of the underpinning dataset. The modelling of the tax-benefit rules reflects the policies in place at that timepoint. For the analysis presented in this paper, a different approach was taken. Given the number of policy changes that occurred in 2020 in Indonesia, a new system (that is, the set of tax and benefit rules) was created for each of the months of 2020 to aid transparency. Monetary values were adjusted month on month using the Consumer Price Index (CPI). The policy changes that were incorporated into INDOMOD are summarized below, and in Annex 3 Table C1.4

• The target number of families for PKH was raised from 9.2 million families (January – March) to 10 million families (April – December)

• The target number of families for BPNT was raised from 15.6 million families (January – March) to 19.4 million families (April – December), and the value of the benefit was increased from IDR 150,000 per month (January – March) to 200,000 per month (April – December)

• A new benefit was introduced called Basic food assistance for Jabodetabek for 2.2 million families, payable at IDR 600,000 per month (April – June) and IDR 300,000 per month (July – December). This is payable to families who are not in receipt of BPNT or PKH.

• A new benefit was introduced called Cash transfer non-Jabodetabek for 9.2 million families in non-Jabodetabek areas, payable at IDR 600,000 per month (April – June) and IDR 300,000 per month (July – December). This is payable to families who are not in receipt of BPNT or PKH.

• A new benefit was introduced called Village Fund cash transfer for 8 million families in non-Jabodetabek rural areas, payable at IDR 600,000 per month (April – June) and IDR 300,000 per month (July – December). This is payable to families who are not in receipt of BPNT or PKH.

• A cash support expansion was introduced for 9 million families (in receipt of BPNT but not PKH), payable as a once off payment of IDR 500,000 per household.

• A wage subsidy was introduced for 12.4 million individuals registered in BPJS Ketenagakerjaan with employment income of less than IDR 5 million per month, comprising two payments of IDR 1.2 million covering a four month period (between August – December).5

• Pre-employment cards were introduced for 5.6 million unemployed individuals who are not in receipt of any social assistance, payable at IDR 600,000 per month for four months (across April – December) plus an incentive payment of IDR 150,000.

Certain policies were not modelled in INDOMOD because the necessary information is not available in SUSENAS.6 The exclusion of these policies means that certain income into the household is not captured and therefore the impact of the COVID response will be underestimated.

The policies introduced in response to the pandemic (including expansion to existing policies) which could be included in INDOMOD are all classified as benefits, and therefore analysis on the impact of the new policies is largely focused on the role of benefits. However, taxes are also impacted by the shock and this is reflected in the analysis of household consumption.

### 4.2. Modelling the shock

To apply income ‘shocks’ to each household in INDOMOD’s input dataset, quarterly data on the sector and province specific economic growth (increase in value added of specific sector and province) was used as a proxy for income growth of the household whose head works in that sector and lives in that particular region (Badan Pusat Statistik (BPS), 2020b). Although the data on economic growth for quarter 1 to quarter 3 was already available at the point when the analysis was undertaken, it had not been released for quarter 4 and so it was necessary for quarter 4 to model separately an estimated income shock.

Following, for example, Sampi and Jooste (2020), Google mobility data was used as the leading variable to help project future economic growth of various sectors and provinces (Google, 2020). More formally, future sector-province specific economic growth was projected with the following formula:

${g}_{i,r,t+k}={\epsilon }_{i}{m}_{r}+{g}_{i,r}^{b}$

Where $g i , r , t + k$ is economic growth of sector i in region r at t+k period, $g i , r b$ is the baseline economic growth before COVID-19 pandemic, $m r$ is the community mobility deviation from before the COVID-19 pandemic and $ε i$ is the elasticity of the growth difference i.e., $g i , r , t + k - g i , r b$ with respect to community mobility deviation in province r, or $m r$ .

Elasticity was estimated econometrically with the following equation:

${g}_{i,r,t}={{\alpha }_{0i}+\epsilon }_{i}{m}_{r,t}+{e}_{i,r,t}$

Where $g i , r , t$ is the growth difference i.e., $g i , r , t - g i , r b$ , $m r , t$ is the deviation of community mobility and $e i , r , t$ is the error terms. To estimate this relationship, economic growth data of ten economic sectors (see Annex 4) and 34 provinces was used. Observations from two quarters were used. The results of the estimation can be found in Annex 5 (1) . Three different kinds of mobilities (workplace, retail and transit) were used and the type of mobility that gave the correct sign with the smallest p-values was selected.7

### 4.3. Modifying the input dataset

As set out in Section 3, INDOMOD is currently underpinned by a dataset that was derived from the March 2019 SUSENAS dataset. As an underpinning dataset for the first quarter of March 2020, it can be expected to function quite well by simply adjusting the income data using the CPI within the model. However, given the large impact of the pandemic and the measures to contain it, it is not appropriate to use this input dataset for subsequent months without first incorporating the ‘shock’ into the dataset. This enables the tax and benefit policies for each month to be applied to more appropriate input datasets that contain in-built estimates of the shock.

The macro-modelling of the shock is described in the previous sub-section. These macro-level estimates were then used to modify some of the key input variables in INDOMOD’s microdataset, following the methodology applied in Lastunen et al., 2021, (forthcoming). The objective is to reduce the total income derived from employment, self-employment (and farm income, for those employed in the agricultural industry), that is earned by workers in each industry by province, by a given proportion depending on the shock estimate for that industry and province. For example, it is assumed that a five percent shock in construction in a particular province would result in the labour income in construction in that province being reduced by five percent.8

This is primarily achieved by randomly removing labour income from workers (of all ages) in construction in that province, regardless of their pre-crisis income, until the cumulative total of income ‘removed’ (i.e. ‘shocked’) matches the aggregate shock estimate for that industry and province. Most of the adjustment is therefore made at the extensive margin. However, when calculating cumulative income totals across weighted survey cases in this way, it is inevitable that the cumulative total will fall either just below or just above the target threshold of the aggregate shock estimate, depending on how many cases are included in the shock (as one weighted survey case in the cumulative distribution will inevitably straddle the threshold value). Therefore, in order to achieve a total income shock from the survey that matched exactly with the aggregate income shock, a further adjustment was made at the intensive margin whereby a uniform scaling adjustment was applied to all remaining workers.

These steps were undertaken for each of quarters 2, 3 and 4 in 2020 to produce three further input datasets. Individuals whose labour income was reduced to zero had their earnings variables correspondingly set to zero, and their employment status variable changed to ‘unemployed’. This was applied to individuals based on their industry and province. For each of quarters 2, 3 and 4, the starting point was the situation in quarter 1 and the relevant shock for the quarter was applied, as described above. Therefore, over the year, for example, an individual in a particular sector might have their earnings reduced to zero (and employment status changed to ‘unemployed’) in quarters 2 and 3, but then return to their quarter 1 situation for quarter 4 if there is a recovery in their particular industry and province. However, these changes are at a cross-sectional level and do not reflect an individual’s transitions in a longitudinal manner.

As poverty is measured in Indonesia using consumption data, the composite consumption variable in the input dataset also had to be adjusted to reflect the shock, and again the approach applied in Lastunen et al., 2021, (forthcoming) was used (see also Lastunen, 2021). First, consumption was allocated to each earner within the household in proportion to their pre-shock earnings, and then for each earner, 25 percent of their consumption was ringfenced as a crude proxy for an undifferentiated mix of consumption achieved via home grown production, use of savings, or the incurring of debt. The remaining consumption was then reduced by a factor derived by multiplying the income shock by the proportion to which earned income had comprised their pre-shock total market income.

In summary, four input datasets were used in the model, one for each quarter of 2020. The dataset for March 2020 or quarter 1 is the INDOMOD dataset constructed from SUSENAS 2019 data, with monetary values uprated to March 2020 on model using the CPI. This the pre-pandemic baseline. The datasets for quarters 2, 3 and 4 are identical to this base dataset, except that the shock has been applied to labour incomes and associated variables, and to the consumption variable.

In order to generate the results, INDOMOD was run 21 times: once for each month in 2020 with the appropriate input dataset; and for quarters 2, 3 and 4 of 2020 the systems were re-run for each month with COVID-19 benefits excluded or ‘switched off’. Results on the impact of the shock of the pandemic and the state-funded tax and benefit policies are presented in the following sections on a quarterly basis, either by averaging the simulated results for the relevant variables for the three months within a quarter, or by using the results for the month at the mid-point of the respective quarter.

### 4.4. Assumptions

The following assumptions relate specifically to the policy changes and new policies introduced in response to COVID-19:

1. The cash support expansion is a one-off payment which was simulated in the model in April as a monthly amount.

2. For the wage subsidy policy, an on-model flag for non-government wage recipient workers was used as a proxy for being registered with BPJS. The wage recipient worker (lwr) variable was not modified in the input datasets, so that even if someone lost all or part of their employment income they could still be identified via the lwr flag. This was important for the wage subsidy policy as it is paid to workers who are furloughed or whose pay is reduced rather than those who lose their jobs, and therefore membership in the social security schemes is assumed to continue.

3. The wage subsidy policy was applied to individuals with pre-crisis employment income (yem00) of less than IDR 5 million per month and shocked employment income (yem) that is less than pre-crisis employment income (who were also non-government wage recipient workers). This resulted in a significant over-simulation of the benefit and therefore it was necessary to apply a ‘dampening’ procedure on model to bring the simulation in line with the targeted number of recipients.

4. A les variable was created specifically for INDOMOD v2.1 and is used in the pre-employment cards policy where it is necessary to identify the unemployed. Anyone not recording ‘working’ as an activity in the last week and also without a job or business to return to was classified as unemployed. However, anyone who also met the criteria for one of the categories of student, inactive, sick/disabled or other was not classified as unemployed. This policy also required a ‘dampening’ procedure on model to bring the simulation in line with the targeted number of recipients.

Regarding the modelled shock on earnings, the main assumption as described above is that the income of households is adjusted using the reported or projected economic growth by sector and province. For quarter 4, economic growth is projected using community mobility data from Google. The four datasets do not have a longitudinal element and thus do not take into account an individual’s transitions across the four quarters into and out of employment, nor do they reflect an individual’s transition between the formal and informal sector.

With regard to analysis of the impact of the pandemic and the taxes and benefits on poverty, certain further assumptions were made. The main assumption, which underpins any analysis using consumption to measure poverty impacts, is that a simulated benefit (income into the household) adds to consumption by the amount of the benefit, while a simulated tax reduces consumption by the amount of the tax. Furthermore, all households are assumed to be liquidity constrained, that is they are unable to borrow to smooth consumption in shock scenarios (see Lastunen et al., 2021, forthcoming). Consumption expenditure is therefore dependent on disposable income. However, in practice the relationship between income and expenditure may not be one-to-one for all consumption items, even in households which are liquidity constrained.

Lastly, the economic shock of the pandemic was considered only with respect to labour income (employment, self-employment and agricultural income). However, it may be that inter-household transfers became an important income stream for mitigating the impact of the crisis, so a focus on tax-benefit policies alone may not give a complete picture (Jara et al., 2021).

## 5. Results - the March 2020 Baseline

In this section, baseline results are presented for March 2020, just at the outset of the pandemic. This provides context for Sections 6 and 7 which compare the four quarters of 2020.

In all sections where poverty results are presented, the poverty measure used is what is commonly referred to as the national poverty line. In fact, the country has a total of 67 poverty lines: 33 urban poverty lines and 33 rural poverty lines for each of the provinces other than Jakarta, and one urban poverty line for Jakarta. These poverty lines are based on consumption, and reflect the variation in prices throughout the country. All 67 lines have been implemented in INDOMOD.

As a starting point, a baseline profile for March 2020 is given in terms of the distributional impact of the benefits that were in place at that time, using simulated results from INDOMOD V2.1. Figure 1 shows the situation in March 2020 with respect to mean monthly household consumption by decile, and the role that the pre-existing benefits were playing before the pandemic took hold. The deciles are created by ranking households according to their per capita household consumption, taking into account household weights. The green bars (mean household consumption by decile including receipt of simulated benefits) show the important role that the benefits had for those in deciles 1-3 in particular, when compared to deciles of household consumption having excluded (i.e. switched off) the simulated benefits (shown in red).

Figure 1

Depicted another way, Figure 2 shows how household consumption would fall if there were no benefits in place in March 2020 (i.e. having switched off all benefits in INDOMOD for the March 2020 timepoint).

Figure 2

The benefit system that was in place ahead of the pandemic was therefore playing an important part in supporting low income families. Indeed, in March 2020 the consumption-based poverty rate would have increased from 6.4 percent to 15.2 percent if there had been no benefits in place, a rise of almost nine percentage points (Table 2). The groups that would have been most adversely affected by the absence of the benefits that were in place prior to the pandemic were households containing one or more older people (their poverty rate would increase by more than 12 percentage points), followed by households containing one or more children (their poverty rate would increase by more than 10 percentage points). The depth of poverty would also have increased substantially in the absence of any benefits, with the FGT1 measure increasing from 0.83 to 5.15. Similarly, consumption-based inequality for March 2020 would have risen from a Gini coefficient of 0.374 to 0.403 if there had been no benefits.

Table 2

The SUSENAS dataset also enables comparable baseline analysis to be undertaken by mean household disposable income, and this is presented in Annex 6. For example, Figure F1 (1) in Annex 6 provides a similar picture to that of Figure 1 but the impact of the benefits is discernible across more of the deciles of mean monthly household disposable income than for consumption. This is also reflected in Figure F2, where the change in mean monthly household income is more pronounced across more of the deciles.

## 6. Results – impact of COVID-19 on earnings

In this section, results are presented on the impact of the COVID-19 pandemic and the containment measures on earnings in the labour market. The results are obtained from INDOMOD’s four input datasets relating to each quarter of 2020, having applied the shocks described in Section 4.

Figure 3 shows the number of workers in the four quarters of 2020 by sector.9 Each sector saw the largest fall in the number of workers between quarter 1 and quarter 2 with the greatest reduction being for those working in the Trade, Hotel and Restaurant sector. Some recovery is evident in quarters 3 and 4, particularly in Trade, Hotel, and Restaurants; Transport; and Services.

Figure 3

The mean monthly employment earnings also dropped in each sector between quarter 1 and quarter 2, apart from Communication (see Figure 4).

Figure 4

## 7. Results – Combined Impact of COVID-19 Pandemic and the Tax-Benefit Policies

In this section, results on the combined impact of the shock of the pandemic and the tax and benefit policies are presented.

### 7.1. Results including the COVID-19 policies

Figure 5 shows that the mean monthly household consumption in Indonesia fell between the first two quarters of 2020, across the whole distribution. Figure 6 shows that in absolute terms the fall in mean monthly household consumption increases by decile, with the greatest fall in absolute terms occurring in the tenth decile. It also shows that the mean monthly household consumption levels did not recover by the fourth quarter to the levels of quarter 1 for any of the ten deciles. This means that even with the automatic stabilisers and the remedial additional benefits, consumption levels did not fully recover by quarter 4 across the whole distribution.10

Figure 5
Figure 6

Figure 7 shows the percentage fall in mean monthly household consumption by decile. All deciles, apart from decile 10, experienced a fall in mean monthly household consumption between quarter 1 and quarter 2 of more than 4 percent. Comparing quarter 3 with quarter 1, deciles 2 to 8 still had a mean monthly household consumption fall of more than 4 percent. By quarter 4, the mean monthly fall in household consumption had reduced to less than 2 percent for decile 10, but was still greater than 2 percent for deciles 1 to 9.

Figure 7

Figure 8 shows the poverty rates for each month for all households (in red), and for households containing one or more children (in yellow), and households containing one or more older people (in purple) (these sub-groups are not mutually exclusive). Overall, household poverty rose from 6.8 percent at the start of the year to a high of 8.3 percent in May, falling by the end of the year to 6.9 percent.

Figure 8

This pattern is broadly repeated by the different household types. Notably, households containing one or more older people, and (to a lesser extent) containing one or more children, have higher poverty levels than the overall household poverty levels in each month. So, households containing one or more children started the year with a poverty rate of 7.6 percent, rising to a high of 9.5 percent in May; and households containing one or more older people started the year with a poverty rate of 10.6 percent, rising to a high of 11.4 percent in May. For both sub-groups, and for the overall population, poverty increased a little between October and December 2020: this is likely to be due to the phasing out of the pre-employment card and wage subsidy COVID-19 policies (see Annex 3).

A subset of these results including poverty depth and inequality measures are presented in Table 3 below which shows how poverty changed between the mid-points of each quarter: February, May, August and November 2020. In November, the poverty rates are slightly lower than the start of the year for the total population and all sub-groups shown, though as can be seen in Figure 8, overall poverty did increase further in December.

Table 3

### 7.2. Results excluding the COVID-19 policies

The question remains though – how might the situation have looked if there had not been additional remedial policies put in place? That is, to what extent would the in-built automatic stabilisers in the tax-benefit system have protected people from the economic shock?

In order to quantify the impact of the additional benefits that were introduced to mitigate the impact of the pandemic, scenarios were modelled in INDOMOD with the new benefits switched off but the original benefits retained. Figure 9 shows the overall poverty rates for each month in 2020, for scenarios without the additional COVID benefits (shown in purple), and with the additional COVID benefits (shown in red, and summarised in Section 4 and Annex 3).

Figure 9

Poverty would have risen to higher levels and would have remained higher than in the first quarter thereafter, without the introduction of the additional support. The new or augmented benefits therefore played a vital role in protecting people from the economic shock of the pandemic in 2020.

To supplement Figure 8, Table 4 shows how poverty changed between February, May, August and November 2020 (the mid-points of the four quarters), for a hypothetical situation where the benefit rules that existed in February 2020 continued throughout the year. Applying the February tax-benefit rules to all four quarters, poverty would have increased overall from 6.8 percent in February to a high of 10.7 percent in May 2020, falling to 9.1 percent in November 2020 (as seen in the purple line in Figure 9). The subgroups that would have been worst affected in May without the additional benefits comprise households containing one or more older people, and households containing one or more children: for these subgroups, poverty would have risen in May 2020 to 14.3 percent and 12.0 percent respectively.

Table 4

The analysis so far has examined the overall impact of the COVID policies and shown the extent to which they mitigated the impact of the pandemic. In order to explore the role of different types of COVID policies, they were grouped into four separate categories: increases to existing benefits, new cash support, new food assistance, and new work-related benefits. Analysis was undertaken to explore the role of these four categories at the mid-points of quarters 2-4 (i.e. May, August and November 2020) – see Table 5. This reveals that the increases to existing benefits made the greatest contribution to poverty reduction in May (44 per cent), followed by cash support (33 per cent). However, in August and November, work-related benefits made the greatest contribution to poverty reduction (51 per cent and 56 per cent respectively). This demonstrates that the policy scene underwent considerable changes during 2020, not just between the period of the first quarter (pre-pandemic) and the rest of the year, but also between quarter 2 and quarter 3 in terms of the augmented support for people of working age.

Table 5

## 8. Conclusion and Discussion

The COVID-19 pandemic is ongoing, and there is great uncertainty about how it will impact on different countries over the next few years. However, the results presented in this paper show that in 2020, Indonesia took swift and decisive action to protect its citizens from both the economic shock of the pandemic and the measures to contain the virus.

The analysis shows that consumption fell across the deciles in quarters 2, 3 and 4 when compared with quarter 1 of 2020 (Figure 6). In absolute terms, the declines were greater for the wealthier deciles (Figure 7). However, in relative terms, the declines were broadly similar across the distribution (Figure 8), though slightly more pronounced for deciles 2-9 than for the poorest and wealthiest deciles.

Prior to the pandemic, around 6.8 percent of people were below the poverty line. Without the introduction of the COVID-19 policies that were simulated in INDOMOD, poverty would have risen to a high in May of 10.7 percent. However, due to the introduction of the COVID-19 policies, our estimates suggest that poverty rose only to a high of 8.3 percent in May, falling by the end of the year to 6.9 percent (Figure 9).

The poverty estimates for 2020 in this paper are lower than those published by BPS for March and September 2020: the official poverty rate in March 2020 was 9.78 percent (Badan Pusat Statistik (BPS), 2020c), and 10.19 percent in September 2020 (Badan Pusat Statistik (BPS), 2020d). In contrast, the simulated results presented in this paper yielded a poverty rate of 6.81 percent for March and 6.83 percent for September 2020 (with the peak occurring in May at 8.30 percent).

There will be several reasons for the discrepancy. First, the official poverty rates were generated using the SUSENAS datasets for March and September 2020, whereas the analysis presented here was generated using a modified version of the SUSENAS 2019 dataset: the analysis was undertaken ‘live’, in tandem with the unfolding of the pandemic and the SUSENAS 2020 datasets were not available at the time. We estimated the impact of the pandemic and associated lockdown on people’s jobs and earnings, using published economic growth data for quarters 2 and 3, and for quarter 4 the impact of the shock was modelled using open source mobility data. Second, the shock was applied to the SUSENAS 2019 dataset by sub-group (sector and province) but there will of course have been variations within each sub-group that are not taken into account. Third, we do not estimate the impact of additional shocks (such as illness or changes in material needs or expenditure patterns) which would have been captured in SUSENAS 2020. And fourth (though this is a counter point) we do not estimate the impact of the unsimulated policies such as the electricity subsidy. Lastly, we simulate the ‘de jure’ tax and benefit rules, rather than the ‘de facto’ application: by assigning benefits to the poorest households within SUSENAS, the benefits will be more precisely assigned to the poorest individuals in our simulations than could occur in practice where eligibility is often determined using the Basis Data Terpadu (Unified Database).

Nevertheless, for the policies that have been modelled, it is clear that they served to protect millions of people from a greater financial shock than would otherwise have been the case. Based on our results, for households containing one or more children, poverty would have risen to a high of 11.99 percent in May 2020 without the COVID-19 policies, but instead rose to 9.49 percent. Also, for households containing one or more elderly people, poverty would have risen to a high of 14.25 percent without the COVID-19 policies, but instead rose to 11.40 percent.

The Government of Indonesia is continuing to apply countercyclical measures in 2021 to handle the COVID-19 pandemic and to mitigate the economic downturn through its 2021 State Budget. The Government’s 2021 fiscal policy direction is intended to be expansive yet consolidative, with the deficit level at 5.7 percent of GDP, and is expected to gradually return to its ceiling of 3 percent of GDP in 2023. The State Budget has been designed to support the return of Indonesia’s economy to its medium-term growth trajectory while anticipating global economic recovery uncertainty.

Understanding the vital role of National Economic Recovery (Pemulihan Ekonomi Nasional/PEN) programmes in preserving the economy and combatting the pandemic, the Government has committed to strengthen this program in 2021. The allocation for PEN programmes is IDR 699.43 trillion to finance health measures and the social safety net, and to support the economic recovery from both the supply and demand-side. That amount is 21 percent higher than the PEN realization in 2020. The additional budget is intended to finance the vaccination program, protect household’s consumption, and create jobs. In terms of supporting household consumption in 2021, especially for poor and vulnerable groups, the Government will maintain PKH for 10 million families, BPNT/Kartu Sembako for 18.8 million families, cash assistance (for people not in receipt of PKH and Kartu Sembako) for 10 million families, the Village Fund cash transfer for 8 million families not in receipt of other programmes, pre-employment cards for 5.6 million unemployed people, a monthly electricity subsidy, and an internet quota subsidy for students and teachers.

These initiatives demonstrate the strong commitment of the Government to protect people from the impact of the pandemic and associated reductions in earnings using adaptive social protection. It will be important to continue to monitor the impact of these policies as the pandemic unfolds, ideally using more up-to-date SUSENAS data and incorporating policy changes beyond 2020. Additionally, an important area for further research is to examine the extent to which different groups were adequately protected from this type of crisis by the standard and emergency measures, and what steps are needed to extend and strengthen such support going forwards.

## Footnotes

### 1.

INDOMOD does not simulate corporate income tax as the underpinning dataset is a household survey. Other taxes that are not simulated include the luxury goods sales tax, excise duty, real estate tax, stamp duty, transfer taxes for land, buildings, and shares; environmental taxes, fuel tax, vehicle tax (administered at regional level), and hotel tax (administered at district level).

### 2.

The Unified Database is an electronic database of the households in Indonesia with the lowest welfare status. It is used for targeting social assistance programmes. See http://tnp2kgoid/data-and-indicator/unified-database.

### 3.

Although it is possible to dampen oversimulated benefits on-model, it is not possible to augment undersimulated benefits and so the on-model benefits were left unadjusted at these levels. External validation data for PKH could not be obtained.

### 4.

See also Annex 1 for an account of how the poorest households were identified in the input data for three of the new COVID benefits.

### 5.

In addition, there was a target of 2 million honorary teachers under the Ministry of Education, and 620,000 honorary teachers under the Ministry of Religious Affairs but these were not simulated in INDOMOD.

### 6.

The policies not modelled include the food assistance expansion/rice subsidy, a monthly electricity subsidy, cash transfers to micro-level businesses, and subsidies, credit guarantees and credit incentives for MSMEs.

### 7.

In the case where no meaningful and significant relationship was found for certain sectors, we assume that the elasticity is zero and use the previous economic growth to carry forward for the next period (we use the lags of growth instead).

### 8.

See the final part of this section for a discussion of other assumptions made.

### 9.

Unless otherwise stated, the quarterly numbers/amounts in this and subsequent figures are obtained by averaging the key variables for the three months in that quarter.

### 10.

See Annex 7 (1) (2) for comparable results using disposable income.

### 11.

Although some policies are targeted at percentage or numbers of families, in INDOMOD the household unit had to be used rather than the family unit.

## Annex 1 Further details about the method for identifying poor families in INDOMOD’s input dataset

### Standardising the expenditure data

As the cost of living is not the same in all parts of Indonesia, the country has a total of 67 poverty lines which vary by province and urban/rural classification. There are 33 urban poverty lines and 33 rural poverty lines for each of the provinces other than Jakarta, and one urban poverty line for Jakarta. The variation in poverty lines reflects the variation in prices throughout the country, and so the poverty line variation was accordingly used to adjust per capita expenditure in INDOMOD’s input dataset. A multiplier was used to convert all expenditure data to Jakarta prices, which was achieved simply by dividing the Jakarta poverty line for 2019 by the poverty lines of all other provinces (both the urban and rural poverty lines were used).

### Identifying the poorest X% of households and the poorest number of households11

Having standardised the expenditure data, two new variables were created in INDOMOD’s input dataset. These were used in INDOMOD as proxies for the household occurring within Indonesia’s Unified Database which is an electronic database of the households in Indonesia with the lowest welfare status and is used for targeting social assistance programmes.12 The first new variable, xpe, gives the percentile of the national standardised expenditure distribution for each household (assigned to the head of household only) in the input dataset. This allows the relevant percentage of the weighted per capita expenditure to be used as the eligibility criterion within the model, depending on the policy (e.g. the bottom 25% for PIP).

For the PKH and BPNT policies, the poorest 9.2 million households and the poorest 15.6 million households respectively are eligible, and therefore a second new variable was constructed to give each household (assigned to the head of household only) their position in the national standardised expenditure distribution. The variable xcu is simply a cumulative number of households ordered from low to high by weighted per capita expenditure. The households positioned in the bottom 9.2 or 15.6 million (or any other threshold desired) can be selected as eligible within the model.

Additional xcu variables were constructed for three of the COVID-19 benefits (summarised in Annex 3): Basic food assistance for Jabodetabek, Cash transfer for non-Jabodetabek non-rural areas, and Village Fund cash transfer for non-Jabodetabek rural areas. For each of these policies, the rules state that the next x million families not in receipt of PKH or BPNT would be eligible for the COVID benefit. Prior to April 2020, when these benefits commenced, the poorest 9.2 million families (households in INDOMOD) received PKH and the poorest 15.6 million families/households received BPNT/Sembako, meaning that 9.2 million households in INDOMOD will receive both PKH and BPNT/Sembako, and an extra 6.4 million households will receive BPNT only. Therefore, any family/household in the poorest 15.6 million would not be eligible for the COVID benefits within INDOMOD as they would be receiving either both PKH and BPNT or just BPNT. In order to calculate the next x million families/households eligible for the COVID benefits, a new ranking of households starting at 15.6 million was calculated within each area (Jabodetabek, non-Bodetabek urban, non-Bodetabek rural) called xcujk, xcunu, xcunr respectively. Using the relevant xcu variable it was then possible to select, on model, the poorest x million not in receipt of PKH or BPNT in a particular area targeted by the benefit.

Table B1
Table B2

Table C1

## Annex 4 Sector codes

Nine sector categories were used (Badan Pusat Statistik (BPS), 2020). Appendix 4—table 1 shows how the 26 business sector codes in SUSENAS were aggregated to BPS’ nine higher level codes with one modification whereby communication and transport were split for the purposes of the analysis presented in this paper as communication and transport were very differently affected during the pandemic.

Table D1

Table E1

Figure F1
Figure F2

Figure G1
Figure G2

## References

1. 1
WIDER Working Paper 2021/148
(2021)
To the rescue? The mitigating role of tax and benefit rescue packages for poverty and inequality in Africa amid the COVID-19 pandemic, WIDER Working Paper 2021/148, Helsinki, UNU-WIDER.
2. 2
3. 3
4. 4
5. 5
6. 6
Profil Kemiskinan Di Indonesia Maret 2020
(2020c)
Jakarta: BPS.
7. 7
Profil Kemiskinan Di Indonesia Maret 2020
(2020d)
Jakarta: BPS.
8. 8
INDOMOD Country Report: Indonesia – INDOMOD V1.3. Report for UNICEF Indonesia
(2019)
INDOMOD Country Report: Indonesia – INDOMOD V1.3. Report for UNICEF Indonesia.
9. 9
INDOMOD Country Report: Indonesia – INDOMOD V2.0. Report for UNICEF Indonesia
(2021)
INDOMOD Country Report: Indonesia – INDOMOD V2.0. Report for UNICEF Indonesia.
10. 10
The potential costs and distributional effect of Covid-19 related unemployment in Ireland (2020)
Economic and Social Research Institute 1.
https://doi.org/10.26504/bp202101
11. 11
EUROMOD Working Paper EM12/20
(2020)
Did the UK policy response to Covid-19 protect household incomes?, EUROMOD Working Paper EM12/20, Colchester, University of Essex.
12. 12
EUROMOD Working Paper EM11/20
(2020)
The Covid-19 Crisis Response Helps the Poor: The Distributional and Budgetary Consequences of the UK Lock- Down, EUROMOD Working Paper EM11/20, Colchester, University of Essex.
13. 13
Life under lockdown: Illustrating tradeoffs in South Africa’s response to COVID-19’
(2020)
World Development 137 :105168.
14. 14
EUROMOD Working Paper EM 06/20
(2020)
Welfare Resilience in the Immediate Aftermath of the COVID-19 Outbreak in Italy, EUROMOD Working Paper EM 06/20, Colchester, University of Essex.
15. 15
A Call to Action for Governments to Expand Children’s Access to Child-Sensitive Social Protection in the Wake of COVID-19
(2020)
A Call to Action for Governments to Expand Children’s Access to Child-Sensitive Social Protection in the Wake of COVID-19.
16. 16
17. 17
Social Protection in Asia and the Pacific: Inventory of Non-Contributory Programmes
(2019)
Brasília: International Policy Centre for Inclusive Growth.
18. 18
WIDER Working Paper 4/2021
(2021)
The role of automatic stabilizers and emergency tax-benefit policies during the COVID-19 pandemic in Ecuador, WIDER Working Paper 4/2021, Helsinki, UNU-WIDER.
19. 19
The Distributional Impact of Fiscal Policy: Experience from Developing Countries
(2017)
The distributional impact of fiscal policy in Indonesia, The Distributional Impact of Fiscal Policy: Experience from Developing Countries, Washington, DC, World Bank.
20. 20
WIDER Working Paper 2020/31
(2020)
Structural transformation and inclusive growth: Kuznets’ ‘developer’s dilemma’ in Indonesia, WIDER Working Paper 2020/31, Helsinki, UNU-WIDER, 10.35188/UNU-WIDER/2020/788-0.
21. 21
WIDER Technical Note 2021/16
(2021)
Deriving Shocks To Household Consumption Expenditures From The Associated Income Shocks Resulting From Covid-19, WIDER Technical Note 2021/16, Helsinki, UNU-WIDER.
22. 22
Policy Research Working Paper No.9247
(2020)
Nowcasting economic activity in times of COVID-19: An approximation from the Google Community Mobility Report, Policy Research Working Paper No.9247, Washington DC, World Bank.
23. 23
WIDER Working Paper 2020/77
(2020)
Precarity and the Pandemic: COVID-19 and Poverty Incidence, Intensity, and Severity in Developing Countries, WIDER Working Paper 2020/77, Helsinki, UNU-WIDER.
24. 24
Estimating the Impact of COVID-19 on Poverty in Indonesia (2020)
Bulletin of Indonesian Economic Studies 56 :175–192.
https://doi.org/10.1080/00074918.2020.1779390
25. 25
EUROMOD: the European Union Tax-Benefit Microsimulation Model
(2013)
Ternational Journal of Microsimulation 6 :4–26.
26. 26
The Future of the Social Protection System in Indonesia: Social Protection for All
(2018)
Jakarta: Tim Nasional Percepatan Penanggulangan Kemiskinan (TNP2K).
27. 27
Looking back to look ahead: A rights-based approach to social protection in the post-COVID-19 economic recovery. Report of the United Nations Special Rapporteur on extreme poverty and human rights
(2020)
Looking back to look ahead: A rights-based approach to social protection in the post-COVID-19 economic recovery. Report of the United Nations Special Rapporteur on extreme poverty and human rights.
28. 28
EUROMOD Software v3.1.8. August 2019
(2019)
EUROMOD Software v3.1.8. August 2019.
29. 29
Towards a Comprehensive, Integrated, and Effective Social Assistance System in Indonesia, Indonesia’s Social Assistance Public Expenditure Review Update.Washington DC:The World Bank (2017)
Towards a Comprehensive, Integrated, and Effective Social Assistance System in Indonesia, Indonesia’s Social Assistance Public Expenditure Review Update.Washington DC:The World Bank, http://documents.worldbank.org/curated/en/535721509957076661/pdf/120905-REVISED-PUBLIC-Screen-English-1211-update.pdf.
30. 30
31. 31
The effect of social protection programs on inequality in Indonesia
(2018)
Report to Asian Development Bank 1.
32. 32
Poverty and Inequality during COVID-19 Pandemic: Early Observations from Indonesia Mimeo
(2020)
Poverty and Inequality during COVID-19 Pandemic: Early Observations from Indonesia Mimeo.

## Article and author information

### Author details

1. #### Gemma Wright

1. College of Graduate Studies, University of South Africa, Pretoria, South Africa
2. Southern African Social Policy Research Insights, Hove, United Kingdom
##### For correspondence
gemma.wright@saspri.org
##### Competing interests
No competing interests reported.
2. #### Michael Noble

Southern African Social Policy Research Insights, Hove, United Kingdom
##### Competing interests
No competing interests reported.
3. #### Helen Barnes

Southern African Social Policy Research Insights, Hove, United Kingdom
##### Competing interests
No competing interests reported.
4. #### Ali Moechtar

1. Fiscal Policy Agency, Jakarta, Indonesia
2. UNICEF Indonesia, Jakarta, Indonesia
##### Competing interests
No competing interests reported.
5. #### David McLennan

Southern African Social Policy Research Insights, Hove, United Kingdom
##### Competing interests
No competing interests reported.
6. #### Arief Anshory Yusuf

Department of Economics, Jawa Barat, Indonesia
##### Competing interests
No competing interests reported.
7. #### Katrin Gasior

Southern African Social Policy Research Insights, Hove, United Kingdom
##### Competing interests
No competing interests reported.
8. #### Ratnawati Muyanto

UNICEF Indonesia, Jakarta, Indonesia
##### Competing interests
No competing interests reported.

### Acknowledgements

The paper is based on analysis that was undertaken as part of the Programme Cooperation Agreement #2018/82/SP/SASPRI between the United Nations Children’s Fund and Southern African Social Policy Research Insights. An earlier version of this paper was published in the CeMPA Working Paper Series https://wwwiseressexacuk/research/publications/working-papers/cempa/cempa2-21.

### Publication history

1. Version of Record published: August 31, 2021 (version 1)


text:
# Equations with Moduli

1. Dec 27, 2014

### Astudious

How does one go about solving equations in one variable which contain moduli? For instance, those of the form f(x,|x|)=0 or f(x,|g(x)|) more generally.

Obviously I don't expect a completely "one-size fits all" solution, but a general approach to dealing with the moduli is what I'm looking for. (i.e. let's assume that, once the moduli are gone, I will be able to deal satisfactorily with the remaining equation.)

2. Dec 27, 2014

### MohammedRady

Get the modulus on one side, and everything else on the other side.

$|f(x)| = g(x)$

Using the definition of the absolute value, $|a| = a$ if $a$ is positive (or 0), and $|a| = -a$ if $a$ is negative, we have two equations:

$g(x) = f(x)$
$g(x) = -f(x)$

You might get extraneous solutions though, so always plug in the values you found into $g(x)$ and make sure $g(x)$ is positive (or zero). If you find that $g(x)$ is negative for a particular value, ignore this solution, since the absolute value of any real number is greater than or equal to zero by definition.

Hope this helps.

By the way, the functions $f$ and $g$ I used in my explanation are in no way related to those in your post, so don't get confused.

3. Dec 28, 2014

### Astudious

Thanks. So we just rearrange into the form above, and then solve the two equations

$g(x) = f(x)$
$g(x) = -f(x)$

and use the superset of the solutions, removing any solutions which lead to g(x)<0 since no modulus of f(x) can equal them.

What if it were something like

$|f(x)| + |g(x)| = h(x)$

?

4. Dec 28, 2014

### MohammedRady

Square both sides.

$[|f(x)| + |g(x)|]^2 = h(x)^2$
$|f(x)|^2 + 2|f(x)||g(x)| + |g(x)|^2 = h(x)^2$

Recall that $a^2 = |a|^2$ and $|a||b| = |ab|$

$f(x)^2 + 2|f(x)g(x)| + g(x)^2 = h(x)^2$
$|f(x)g(x)| = \frac{1}{2} [h(x)^2 - f(x)^2 - g(x)^2]$

You now have the equation in the form you mentioned in your first post.

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

format: plain


text:
# Rootfinding for nonlinear equations

Rootfinding for nonlinear equations

Here we want to solve an equation of the kind ${\displaystyle f(x)=0}$.

Suppose that there exist ${\displaystyle \alpha \in \mathbb {R} }$ such that ${\displaystyle f(\alpha )=0}$. Then we want to construct a sequence ${\displaystyle x_{k}}$, with ${\displaystyle k\in \mathbb {N} }$, such that

${\displaystyle \lim _{k\to \infty }x_{k}=\alpha }$

The number ${\displaystyle \alpha }$ is called root (of the function ${\displaystyle f}$).

## Convergence

If the sequence defined by the numerical method converges, we can ask what the rate of convergence is. With this aim, we define the order of convergence of a sequence :

Definition (Order of convergence). A sequence ${\displaystyle x_{k}}$ converges to ${\displaystyle \alpha }$ with order ${\displaystyle p\geq 1}$ if

${\displaystyle |x_{k+1}-\alpha |=C|x_{k}-\alpha |^{p},\quad \forall k>0,}$

${\displaystyle p}$ is the order of convergence of the numerical method that has generated the sequence ${\displaystyle x_{k}}$. The constant ${\displaystyle C}$ is called rate of convergence. If ${\displaystyle p=1}$ and ${\displaystyle C}$ is between 0 and 1, the convergence is said to be linear convergence.Under the linear convergence condition,if ${\displaystyle C=0}$, the sequence is said to converge superlinearly and if ${\displaystyle C=1}$, then the sequence is said to converge sublinearly.

The quantity

${\displaystyle e_{k+1}\equiv |x_{k+1}-\alpha |}$

represents the error at step ${\displaystyle k}$. In general, with a numerical method, we do a finite number of iterations and for this reason we seek only an approximation ${\displaystyle x_{k+1}}$ of the true root ${\displaystyle \alpha }$. In particular, we can define a tolerance ${\displaystyle \epsilon }$ such that if ${\displaystyle |x_{k+1}-\alpha |\leq \epsilon }$,we can stop the iteration and conclude that ${\displaystyle x_{k+1}}$ is the approximation of the true root.

### Example

Suppose that the sequence ${\displaystyle x_{k}}$ converges to ${\displaystyle \alpha }$ with order 2, where the constant ${\displaystyle C=1}$, and suppose that the initial error ${\displaystyle e_{0}=|x_{0}-\alpha |=10^{-1}}$. Consider a tolerance ${\displaystyle \epsilon =10^{-10}}$, then we can find the approximation of the true root by using the definition of convergence.Hence,

${\displaystyle e_{1}=|x_{1}-\alpha |=|x_{0}-\alpha |^{2}=10^{-2}}$

which is greater than the tolerance, so we should keep going until the error is less than the tolerance. We can get

${\displaystyle e_{2}=|x_{2}-\alpha |=|x_{1}-\alpha |^{2}=10^{-4}}$

which is also greater than the tolerance, thus we should do the iteration to calculate

${\displaystyle e_{3}=|x_{3}-\alpha |=|x_{2}-\alpha |^{2}=10^{-8}}$

which is still larger than the tolerance. Similarly,

${\displaystyle e_{4}=|x_{4}-\alpha |=|x_{3}-\alpha |^{2}=10^{-16}}$

which is less than the tolerance. Therefore, we can stop here and can conclude that ${\displaystyle x_{4}}$ is the approximation of the true root.

YangOu (talk) 02:44, 26 October 2012 (UTC)


text:
# 14 Multiple Regression I

Chapters 4 and 5 from Abdi, Edelman, Dowling, & Valentin59.

## 14.2 Overview

The purpose of this lab is to show how simple linear regression (using a line) can be extended into multiple linear regression (using a plane or hyperplane).

Before we begin, let’s take stock of how far we got last semester. Remember, the entire purpose of this course is to understand how statistical inference is applied to experimental designs. In experimental designs, researchers are interested in whether manipulations to one experimental variable cause change in a measured dependent variable. Last semester we considered very simple situations involving one independent variable (manipulation) with two levels, and one dependent variable (measure. A design like this could be analyzed with a t-test.

Note also, that by the end of last semester we began discussing another relatively simple situation involving two variables, a predictor variable and a dependent variable; and, we saw how linear regression could be applied to examine potential linear relationships between a predictor variable and dependent variable. As the above figure implies, there can be a relationship between both of the simple situations. In this lab, we will show that a t-test and a simple linear regression can be equivalent. This equivalence also exists for more complicated designs, and throughout the semester we will show that ANOVAs and Multiple Linear Regression are different expressions of the same analysis.

The entire rest of this semester focuses on expansions of the simplest experimental design (one independent variable with two levels, and one dependent variable). For example, one way to expand on this design is to increase the number of levels of a single independent variable. We will see that designs with multiple levels can be analyzed with ANOVA (Analysis of Variance) or Linear Regression, and both with produce the same results.

Another way to expand the simple design is to increase the number of manipulations, or independent variables. Designs with multiple IVs, each with multiple levels, can all be analyzed with ANOVA and Multiple Linear Regression, to produce the same results.

## 14.3 Concept I: t-tests and simple regression

Throughout the course we will be mostly focusing on extensions to the t-test in the form of ANOVA (Analysis of Variance). These extensions allow for analyses of more complicated designs with multiple independent variables each with multiple levels. However, before we discuss ANOVA, we spend this lab and the next one discussing multiple linear regression. This is because linear regression can also be extended to handle the same more complicated designs. The extension is termed multiple linear regression. Last, ANOVA and multiple linear regression are fundamentally the same analysis, they produce the same results.

The relationship holds true for simple designs too. So, before we head into multiple linear regression, let’s quickly revisit simple linear regression and see how it can be the same as a t-test.

### 14.3.1 Independent sample t-test for two groups

Let’s quickly make some sample data for an experiment with two groups that could be analyzed with a t-test.

library(tibble)
simple_design <- tibble(group = rep(c(0,1), each=10),
DV = c(1,3,2,4,3,4,5,6,5,4,5,4,3,2,3,4,5,6,8,9))

Here’s a table of the data (arranged in long-format):

knitr::kable(simple_design)
group DV
0 1
0 3
0 2
0 4
0 3
0 4
0 5
0 6
0 5
0 4
1 5
1 4
1 3
1 2
1 3
1 4
1 5
1 6
1 8
1 9

Here’s a bar graph showing the means for each group, and the data-points for each subject overlaid on top of the bars.

library(ggplot2)

ggplot(simple_design, aes(x=group, y=DV))+
geom_bar(stat = "summary", fun = "mean", position="dodge")+
geom_point()

Here’s the t-test results:

t.test(DV~group, var.equal=TRUE, data=simple_design)
#>
#>  Two Sample t-test
#>
#> data:  DV by group
#> t = -1.412, df = 18, p-value = 0.175
#> alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
#> 95 percent confidence interval:
#>  -2.9854404  0.5854404
#> sample estimates:
#> mean in group 0 mean in group 1
#>             3.7             4.9

### 14.3.2 Linear regression for two groups

It is common to apply linear regression to a situation involving two continuous variables. However, we can also apply simple linear regression to the above situation. For example, the predictor variable is ‘group’, and it ranges from 0 to 1. The dependent variable is ‘DV’.

We can add a regression line to the graph. Notice that the regression line goes across the boundaries from 0 to 1 (even though there is no data in between 0 and 1). Also, notice that the regression line crosses exactly at the mean for group. This is because the regression line is the line that goes through the means of the two levels.

ggplot(simple_design, aes(x=group, y=DV))+
geom_bar(stat = "summary", fun = "mean", position="dodge")+
geom_point()+
geom_smooth(method="lm", se=FALSE)

Next, we conduct a linear regression on the same data.

lm(DV~group, data=simple_design)
#>
#> Call:
#> lm(formula = DV ~ group, data = simple_design)
#>
#> Coefficients:
#> (Intercept)        group
#>         3.7          1.2

Notice the intercept is 3.7. This is value of DV on the line when group = 0, and it is also the mean value of DV for group 0. Notice that the coefficient for group is 1.2. This represents the idea that as the line goes up by 1, the value of DV will go up by 1.2. So, if we go from group = 0, to group =1, we should go from 3.7 to 3.7+1.2 = 4.9. Notice, that 4.9 is the mean of group 1.

Last, we can look at a summary of the linear regression. Notice that the p-value is .175, the same as the t-test from above. Notice that there is no t-value here, however the square root of the F-value 1.994 is 1.412, which is the same as the t-value from the t-test.

summary(lm(DV~group, data=simple_design))
#>
#> Call:
#> lm(formula = DV ~ group, data = simple_design)
#>
#> Residuals:
#>    Min     1Q Median     3Q    Max
#>  -2.90  -1.10   0.10   1.15   4.10
#>
#> Coefficients:
#>             Estimate Std. Error t value Pr(>|t|)
#> (Intercept)   3.7000     0.6009   6.157 8.18e-06 ***
#> group         1.2000     0.8498   1.412    0.175
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 1.9 on 18 degrees of freedom
#> Multiple R-squared:  0.09972,    Adjusted R-squared:  0.04971
#> F-statistic: 1.994 on 1 and 18 DF,  p-value: 0.175

## 14.4 Concept II: Adding more levels is still simple linear regression

We ended last lab with an assignment to read Slamecka, N. J.60 The research design from that paper is used in chapter 561 to explain multiple orthogonal linear regression. We are working toward explaining this example. The full design has two independent variables, each with three levels. Before we take a look at that, let’s consider the issue of extending the number of levels for one independent variable.

### 14.4.1 A simplified memory experiment

Let’s simplify the Slamecka62 experiment for the moment. Read the following sentence one time:

“We must postulate that from strictly semantic points of vantage, most confusions in communication revolve about inadequate stipulation of meaning.”

Now, imagine that in 5 minutes you try to recall the entire sentence from memory. The original sentence has 20 words. How many do you think you can correctly recall?

In Slamecka63, subjects were given sentences with 20 words in them, and they had different amounts of practice, termed Original Learning (OL). Some subjects got 2, 4, or 8 trials of practice on sentence. Thus, the first Independent variable is OL (or amount of practice), and it had three levels, 2, 4, and 8.

The expectation is that manipulating amount of practice will change memory performance. Specifically, the more you practice the sentence, the more you will be able to remember it. I created a quick sketch to illustrate the basic predictions.

Notice this prediction graph is not terribly different from the t-test graph from the previous example. Instead of groups 0 and 1 on the x-axis, we have three levels of practice, 2, 4, and 8. If we ran this experiment, we might expect that memory performance goes up as the amount of practice goes up, and we could put line on the data as a basic way to see if the amount of practice actually has an effect. If practice has no effect, then the line would be flat. If there is an effect, then the line would go up like the yellow line in the graph.

So, let’s quickly reproduce this situation in R. I’ll imagine we have data for 3 subjects in each practice condition. And, I make up some numbers to reflect the idea that more practice will lead to more words recalled. Finally, we fit a regression line.

recall_design <- tibble(practice = rep(c(2,4,8), each=3),
subjects = 1:9,
recall = c(5,7,8,
8,10,12,
12,15,17))
knitr::kable(recall_design)
practice subjects recall
2 1 5
2 2 7
2 3 8
4 4 8
4 5 10
4 6 12
8 7 12
8 8 15
8 9 17

ggplot(recall_design, aes(x=practice, y=recall))+
geom_bar(stat = "summary", fun = "mean", position="dodge")+
geom_point()+
geom_smooth(method="lm", formula = y~x, se=FALSE)

There are some tiny wrinkles here to note. If you look closely, the regression line does not go exactly through the means for each level of practice. Also, the bar for 8 trials of practice is far away from the bar for 4 trials of practice.

What is happening here is that the levels of practice variable is being treated as a continuous variable. When the independent variable is treated like a continuous predictor variable, the regression and ANOVA will be the same, but the regression line may not go through the means in each level.

summary(lm(recall~practice, data=recall_design))
#>
#> Call:
#> lm(formula = recall ~ practice, data = recall_design)
#>
#> Residuals:
#>     Min      1Q  Median      3Q     Max
#> -2.8095 -1.5714  0.1905  1.0476  2.4286
#>
#> Coefficients:
#>             Estimate Std. Error t value Pr(>|t|)
#> (Intercept)   4.3333     1.3678   3.168  0.01575 *
#> practice      1.3095     0.2585   5.066  0.00145 **
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 1.934 on 7 degrees of freedom
#> Multiple R-squared:  0.7857, Adjusted R-squared:  0.7551
#> F-statistic: 25.67 on 1 and 7 DF,  p-value: 0.001453
summary(aov(recall~practice, data=recall_design))
#>             Df Sum Sq Mean Sq F value  Pr(>F)
#> practice     1  96.03   96.03   25.67 0.00145 **
#> Residuals    7  26.19    3.74
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

It is also possible to treat the independent variable as a categorical variable. We can do this be redefining the practice variable as factor in R. This has a couple different consequences. First, the bar for 8 trials of practice is now located beside the 4. It is now considered to be one category away, and not four steps away, from 4. Also, ggplot2 does not show the regression line even though we asked it to draw one. And, the results of the linear regression and ANOVA are different than before (although they are the same as each other).

recall_design$practice <- as.factor(recall_design$practice)

ggplot(recall_design, aes(x=practice, y=recall))+
geom_bar(stat = "summary", fun = "mean", position="dodge")+
geom_point()+
geom_smooth(method="lm", formula = y~x, se=FALSE)

summary(lm(recall~practice, data=recall_design))
#>
#> Call:
#> lm(formula = recall ~ practice, data = recall_design)
#>
#> Residuals:
#>     Min      1Q  Median      3Q     Max
#> -2.6667 -1.6667  0.3333  1.3333  2.3333
#>
#> Coefficients:
#>             Estimate Std. Error t value Pr(>|t|)
#> (Intercept)    6.667      1.186   5.620  0.00136 **
#> practice4      3.333      1.678   1.987  0.09413 .
#> practice8      8.000      1.678   4.768  0.00310 **
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 2.055 on 6 degrees of freedom
#> Multiple R-squared:  0.7927, Adjusted R-squared:  0.7236
#> F-statistic: 11.47 on 2 and 6 DF,  p-value: 0.008905
summary(aov(recall~practice, data=recall_design))
#>             Df Sum Sq Mean Sq F value Pr(>F)
#> practice     2  96.89   48.44   11.47 0.0089 **
#> Residuals    6  25.33    4.22
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

## 14.5 Concept III: Multiple orthogonal linear regression

Slamecka64 manipulated a second independent variable in addition to practice. The second variable was called interpolated learning (IL), and it also had three levels (0,4,8). Here’s what happened. After subjects practiced learning a sentence they had to learn some MORE sentences. These additional sentences would likely have a distracting effect.

How well would you remember this sentence…

“We must postulate that from strictly semantic points of vantage, most confusions in communication revolve about inadequate stipulation of meaning.”

If that’s all you had to do (0 distraction sentences afterwards). How well would you remember the above sentence if you had to practice this new sentence four times:

“Communicators can exercise latitude in specifying meaning however they choose, provided that such definitions correspond somewhat closely to customary usage.”

What if you had to practice the new sentence 8 times? The expectation was that your memory for the first sentence would get worse as you practiced additional sentences that would probably distract you from the first one.

The design was a 3x3 design. The first independent variable was amount of practice on the first sentence (2,4,8 trials of original learning). The second independent variable we’ll call amount of distraction sentences (interpolated learning: 0,4,8). The design was fully crossed, which means that each level of the first independent variable was paired with each level of the second. There are 3x3 = 9 total cells in the design. Here are some general expectations for the data:

Notice there are 9 dots representing rough predictions for memory recall in each of the 9 conditions (cells) in the design. The practice variable is indicated on the x-axis. The distraction variable is indicated by different colors and connected lines.

Just like in Concept section II, we expect that increasing practice will increase the number of words recalled. We can see the prediction for the practice variable (IV) in all of the colored lines. They all move up to the right, indicating that the more you practice a sentence, the more we expect you to remember more words from the sentence.

The predictions for the second IV, the distraction variable can be see by looking at the colored lines. When there is 0 distraction, we expect the best performance overall, so the blue line representing 0 distraction is at the top. When there is 4 trials of distraction, we expect memory performance to go down, so the green line is lower than the blue line. Finally, when there is 8 trials of distraction, we expect memory performance to go down even more. So, the yellow lines is below the green line.

These trends are referred to as “main effects”. We expect the main effect of practice to increase memory performance. We expect the main effect distraction to decrease memory performance. We expect that both things can happen at the same time, so the total memory performance is basically the sum of your practice minus the distraction.

To follow along with your textbook, we can visualize predictions for performance in this design in terms of 3-D space. One dimension represents the DV (more or less memory recall), and the other two dimensions represent the IVs (more or less practice, and more or less distraction). When we only had one IV, we could look for the best fit line relating the IV to the DV. Now, that we have two IVs we have to add a dimension to our line. A two-dimensional line is a plane. So, when we have two IVs, we can find the best fit plane that runs through the means in each cell in the design.

Multiple linear regression can be extended to as many IVs as you like. However, it becomes difficult to visualize the extensions. We can go from a line to a plane, but it’s harder to visualize what happens when you add a third IV to the mix. This would require a four-dimensional graph that is hard to draw. But, we would extend the plane just like we did before, and there would be some best fit cube. As we keep adding more IVs, we need more and more geometrical dimensions that we can’t visualize. To keep things “simple”, in those situations we say that we are fitting a “hyperplane” to the data.

Summary: The main purpose of the preceding section was to illustrate that multiple linear regression has a geometric interpretation, and that the geometric interpretation can be extended from a simple 2-D space involving one IV and one DV, to a 3-D space involving 2 IVs and one DV, and beyond.

## 14.6 Practical I: Simulating Slamecka (1960)

The purpose of this section is to conduct the Slamecka65 example from the textbook in R. Note, that in the original design the IL (number of interpolated lists) had three levels 0, 4, and 8. In the textbook, the 0 is a 2. To align with the textbook, we use a 2 here too.

### 14.6.1 Representing the data in long-form

slamecka_design <- tibble(number_of_learning_trials = rep(c(2,4,8), each=6),
number_of_IL = rep(rep(c(2,4,8), 2), 3),
subjects = 1:18,
recall = c(35,21,6,
39,31,8,
40,34,18,
52,42,26,
61,58,46,
73,66,52
)
)

knitr::kable(slamecka_design)
number_of_learning_trials number_of_IL subjects recall
2 2 1 35
2 4 2 21
2 8 3 6
2 2 4 39
2 4 5 31
2 8 6 8
4 2 7 40
4 4 8 34
4 8 9 18
4 2 10 52
4 4 11 42
4 8 12 26
8 2 13 61
8 4 14 58
8 8 15 46
8 2 16 73
8 4 17 66
8 8 18 52

### 14.6.2 Visualizing the data

ggplot(slamecka_design,aes(x=number_of_IL,
group = number_of_learning_trials,
y=recall))+
geom_line(stat = "summary", fun = "mean")+
geom_point(stat = "summary", fun = "mean",)+
theme_classic()

### 14.6.3 Running the multiple regression in R

Note, the main purpose of this example is to show correspondence between the fully worked out example in the textbook, and output from R.

lm(recall~ number_of_learning_trials + number_of_IL,data = slamecka_design)
#>
#> Call:
#> lm(formula = recall ~ number_of_learning_trials + number_of_IL,
#>     data = slamecka_design)
#>
#> Coefficients:
#>               (Intercept)  number_of_learning_trials
#>                        30                          6
#>              number_of_IL
#>                        -4

summary(lm(recall~ number_of_learning_trials + number_of_IL,data = slamecka_design))
#>
#> Call:
#> lm(formula = recall ~ number_of_learning_trials + number_of_IL,
#>     data = slamecka_design)
#>
#> Residuals:
#>    Min     1Q Median     3Q    Max
#>   -9.0   -4.0    0.5    4.0    6.0
#>
#> Coefficients:
#>                           Estimate Std. Error t value Pr(>|t|)
#> (Intercept)                30.0000     3.3993   8.825 2.52e-07 ***
#> number_of_learning_trials   6.0000     0.4818  12.453 2.60e-09 ***
#> number_of_IL               -4.0000     0.4818  -8.302 5.44e-07 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 5.099 on 15 degrees of freedom
#> Multiple R-squared:  0.9372, Adjusted R-squared:  0.9289
#> F-statistic:   112 on 2 and 15 DF,  p-value: 9.609e-10

## 14.7 Practical II: Graphing designs with multiple IVs and levels

This section provides several example code snippets of using ggplot2 to graph means from designs with multiple IVs and levels.

Notice the textbook version the Slamecka results plotted number of interpolated learning trials on the x-axis, whereas in concept section III, we had plotted amount of practice on the x-axis. It’s easy to swap this around, by assigning different variables to x or group.

ggplot(slamecka_design,aes(x=number_of_IL,
group = number_of_learning_trials,
y=recall))+
geom_line(stat = "summary", fun = "mean")+
geom_point(stat = "summary", fun = "mean",)+
theme_classic()
slamecka_design$number_of_IL <- as.factor(slamecka_design$number_of_IL)

ggplot(slamecka_design,aes(x= number_of_learning_trials,
group = number_of_IL,
y=recall))+
geom_line(stat = "summary", fun = "mean")+
geom_point(stat = "summary", fun = "mean", aes(shape=number_of_IL))+
theme_classic()

### 14.7.1 facet-wrapping

ggplot2 has a very useful function called facet_wrap() that can be used to graph complicated designs in different ways.

Facets are created for each level of an independent variable. Below, we at facets for each level of the distraction (IL) variable.

ggplot(slamecka_design,aes(x= number_of_learning_trials,
y=recall))+
geom_line(stat = "summary", fun = "mean")+
geom_point(stat = "summary", fun = "mean")+
theme_classic() +
facet_wrap(~number_of_IL)

Let’s imagine that there were 6 subjects in the experiment, and they were assigned to the conditions in the following manner:

slamecka_design <- tibble(number_of_learning_trials = rep(c(2,4,8), each=6),
number_of_IL = rep(rep(c(2,4,8), 2), 3),
subjects = rep(1:6, each=3),
recall = c(35,21,6,
39,31,8,
40,34,18,
52,42,26,
61,58,46,
73,66,52
)
)

knitr::kable(slamecka_design)
number_of_learning_trials number_of_IL subjects recall
2 2 1 35
2 4 1 21
2 8 1 6
2 2 2 39
2 4 2 31
2 8 2 8
4 2 3 40
4 4 3 34
4 8 3 18
4 2 4 52
4 4 4 42
4 8 4 26
8 2 5 61
8 4 5 58
8 8 5 46
8 2 6 73
8 4 6 66
8 8 6 52

I made this change to illustrate that facet_wrap can create facets that combine two variables, in this practice and individual subjects:

ggplot(slamecka_design,aes(x= number_of_IL,
y=recall))+
geom_line()+
geom_point()+
theme_classic() +
facet_wrap(~number_of_learning_trials*subjects, ncol=2)

## 14.8 Lab 2 Generalization Assignment

### 14.8.1 Instructions

Your assignment instructions are the following:

1. Work inside the new R project for stats II that you created
2. Create a new R Markdown document called “Lab2.Rmd”
3. Use Lab2.Rmd to show your work attempting to solve the following generalization problems. Commit your work regularly so that it appears on your Github repository.
4. For each problem, make a note about how much of the problem you believe you can solve independently without help. For example, if you needed to watch the help video and are unable to solve the problem on your own without copying the answers, then your note would be 0. If you are confident you can complete the problem from scratch completely on your own, your note would be 100. It is OK to have all 0s or 100s anything in between.

### 14.8.2 Problems

1. (3 points) The following code roughly reproduces figure 5.5 from the textbook.66 Modify the ggplot code so that the graph looks as close as possible to the figure from textbook:
• change the x-axis title
• change the y-axis title
• make the x-axis and y axis ticks the same
• include different symbols to differentiate the lines
slamecka_design <- tibble(number_of_learning_trials = rep(c(2,4,8), each=6),
number_of_IL = rep(rep(c(2,4,8), 2), 3),
subjects = 1:18,
recall = c(35,21,6,
39,31,8,
40,34,18,
52,42,26,
61,58,46,
73,66,52
)
)

ggplot(slamecka_design,aes(x=number_of_IL,
group = number_of_learning_trials,
y=recall))+
geom_line(stat = "summary", fun = "mean")+
geom_point(stat = "summary", fun = "mean",)+
theme_classic()
1. (3 points) The Slamecka design was a 3x3 design. The practice variable had three levels (2, 4, and 8), and was assumed to increase memory recall with increasing amount of practice. The interpolated learning (IL or distraction) variable had three levels (0, 4, and 8), and was assumed to decrease memory recall with increasing amounts of distraction.

Imagine Slamecka had included a third independent variable that also had three levels. This new IV is expected to increase memory recall. For example, maybe the third IV is amount of reward given to subjects (0, 50 dollars, 1 million dollars) for completing the study. As the amount of expected reward is increased, subjects are more motivated so they remember more words.

Use R to create a dataframe to represent predictions for this new 3x3x3 design. Then use ggplot and facet wrapping to show predicted means for each condition. As a hint, I have provided a drawing and I expect your ggplot graph will look something like this drawing.


text:
# Are there any tricks I can use to pull SO2F2 out of the air?

A massive apartment complex near where I live is being fumigated with Vikane gas (sulphuryl flouride, $\ce{SO2F2}$). The process will take a long time (weeks) because there are a lot of buildings, and their tents appear to have rips in them, clearly visible: several neighbors have complained of symptoms of exposure to the gas, and I'm worried about it in my home. Obviously we should try to get them to stop / etc., but that's a matter of law and politics not meant for a chemistry site.

In the meantime, what I would like to know is if there is any safe way I can use to pull the gas out of the air if it should waft its way into my home. My understanding is that activated charcoal will not work for this molecule. I've heard that either strong bases (usually photo-developing chemicals are mentioned) or heavy water vapor reacts with the gas; but I'm not sure what that reaction is, or if it would result in something better or worse than the gas itself. I've tried Googling but with just a high school chemistry exposure some decades ago, I can't make much headway. Please note that I do not have access to any chemicals or machines I can't readily buy in a nearby store. My goal is to turn it into some liquid or solid, or bind it to such, so that I can't breath it in.

• Pumping all the air in your house through a system is going to take a fairly serious set of fans, much less continuously running a system to try and remove the gas from all the surrounding air as quickly as it diffuses in. – Aesin Oct 24 '13 at 20:04
• I guess I should have clarified; I realize it's unfeasible to remove all trace of the stuff; I just want to mitigate damage as much as possible. For instance, they're also spraying Termidor (fipronil), which has carbon chains. I put out activated charcoal and set a few fans blowing, just to try to pull out of the air what it can. – jdowdell Oct 25 '13 at 0:31
• Without some sort of high-performance fan/filter system, it's going to be seriously difficult to mitigate things to any significant extent. Here's a kicker for you: the gas you refer to is significantly denser than air, and will tend to sink. Unless you spend a lot of time near the ground (or have small pets), putting lots of fans without a dedicated filter system will probably kick the gas up and increase your exposure. – chipbuster Oct 27 '13 at 17:45