logo

Section 1: This is the first section

This is a template for your weekly work. You can write text, include images, write equations, and include R code. The text below is provided just for demonstration, you can save it elsewhere and replace by your work.

💡 Tip

  1. You can rename the files in the project to something like TimeSeriesWeek1.R and TimeSeriesWeek1.Rmd and keep them in the TimeSeriesWork project folder. Or
  2. You can also rename the folder to TimeSeriesWeek1 and the project file to TimeSeriesWeek1.Rproj and keep one folder for each week

⚠️ Warning Do not use spaces in file names or folder names. They migh not cause problems today, but will some time in the future.

1.1 The first subsection

There needs to be an empty line before a line starting with # or ## otherwise section headings will not display properly.

1.2 The second subsection

You can write R code inline as follows {r}x <- 1:10. This is called inline code. You can also write code in a separate block as follows:

# ENSO is a time series related to the 
# El Nino effect weather pattern in the South Pacific
# run ?astsa::ENSO for more information
library(astsa)
start(ENSO)
## [1] 1951    1
end(ENSO)
## [1] 2022   10
frequency(ENSO)
## [1] 12

This is called a code chunk.

If you want to hide the code, just add echo=FALSE in the chunk options.

## [1] 1951    1
## [1] 2022   10
## [1] 12

1.3 Tree Cover Loss in Indonesia (Time Series)

The plot below displays the tree cover loss over time (in hectares) in Indonesia from the year 2000 to 2024. It shows how deforestation has changed every year.

I decided to pursue this project because of the increasing concerns regarding deforestation, particularly in Indonesia. Indonesia is a key player in palm oil production, and relies heavily on pal oil exports. I wanted to analyse the yearly trend of tree cover loss and see any noticeable fluctuations or patterns. The time series plot suggests that the trend of tree cover loss in Indonesia is not consistent, and there are no patterns in deforestation. The graph also highlights several fluctuations, for example, between the years of 2011 and 2012, as well as 2015 and 2016. The main reasons for tree cover loss are due to deforestation for palm oil plantations, the expansion of agriculture and mining activities, illegal logging, and forest fires. The years leading up to covid, the tree cover loss (in hectares) decreased a lot, especially during 202. It was below 750000 hectares, which was last seen in 2003. This could be due to reduced activity from these industries during the COVID-19 pandemic.

Linear modelling data Residuals (Min-Max): The large difference between the minimum and maximum residuals, -289705 and 1708439 suggests that the model may not fit the data well.

Multiple R-squared:The value of 0.000786 is very insignificant, which means that amount of trees lost does not depend on the year.

F-statistic: The small value F-statistic of 0.08889 indicates that the amount of trees lost does not depend on the year.

All of these data shows that tree cover loss is not easily predictable because Indonesia is prone to a lot of natural disasters such as earthquakes, tsunamis, and forest fires (in 2015-2016) which heavily affects the amount of trees lost. For future modelling.

Limitations: This type of data is heavily dependent on external factors such as natural disasters and sudden policy changes. Perhaps we could model a better data if we have more information on the tree cover loss excluding any drastic external factors.

## 
## Call:
## lm(formula = umd_tree_cover_loss__ha ~ umd_tree_cover_loss__year, 
##     data = treecover_loss_ha)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -289705 -259464 -220083  -94281 1708439 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)
## (Intercept)               -3742272   13451563  -0.278    0.781
## umd_tree_cover_loss__year     1993       6686   0.298    0.766
## 
## Residual standard error: 475600 on 113 degrees of freedom
## Multiple R-squared:  0.000786,   Adjusted R-squared:  -0.008057 
## F-statistic: 0.08889 on 1 and 113 DF,  p-value: 0.7661

1.4 Callout blocks

📘 Callout blocks

You can typeset callout blocks by writing text after the > character.

You can also add emojis to make it look nice.

⚠️ Important

Your RMarkdown file should not include R instructions such as:

  • install.packages("..."), or
  • help(...) or ?...,
  • data() or data(package="..."),
  • View(...),
  • Or any other instruction that displays data in a separate window or requires user input.

as they are not suitable for an HTML document.

Run them in the console as part of your development. But not in the RMarkdown document.

Section 2: This is the second section

2.1 Including image files

You can include images with ![](images/QMlogo.png)

2.2 Displaying plots

You can also display plots. For example, the code below will display a plot of the ENSO data.

plot(ENSO)

2.3 Writing equations

In the course we will not use this much, but in case you want, you can also write equations using \(\LaTeX\). For example, the equation of a straight line is \(y = mx + b\). \[ z=\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}x^2} \] etc.