I attached the instruction file as word file and raw data exceel. XXXXXXXXXXSubmit Excel (With analysis sheet) and Word file as per instruction.

2 answer below »
I attached the instruction file as word file and raw data exceel. Submit Excel (With analysis sheet) and Word file as per instruction.


Title Page Effects of climate change on global food production under SRES emissions and socio-economic scenarios Data set developed by Ana Iglesias of Universidad Politecnica de Madrid and Cynthia Rosenzweig of the NASA Goddard Institute for Space Studies and disseminated by the NASA Socioeconomic Data and Applications Center (SEDAC), managed by CIESIN at Columbia University March 2010 http://sedac.ciesin.columbia.edu/mva/cropclimate/ Data Description In the coming decades the agricultural sector faces many challenges stemming from growing global populations, land degradation, and loss of cropland to urbanization. Although food production has been able to keep pace with population growth on the global scale, periodically there are serious regional deficits, and poverty related nutritional deficiencies affect close to a billion people globally. In this century climate change is one factor that could affect food production and availability in many parts of the world, particularly those most prone to drought and famine. The purpose of this data set is to provide an assessment of potential climate change impacts on world staple crop production (wheat, rice, and maize) with a focus on quantitative estimates of yield changes based on multiple climate scenario runs. The data set assesses the implications of temperature and precipitation changes for world crop yields taking into account uncertainty in the level of climate change expected and physiological effects of carbon dioxide on plant growth. Adaptation is explicitly considered and incorporated into the results by assessing the country or regional potential for reaching optimal crop yield. Optimal yield is the potential yield non limited by water, fertilizer, and without management constraints. Adapted yields are evaluated in each country as a fraction of the potential yield. The weighting factor combines the ratio of current yields to current yield potential and the economic limitation of the economic country’s agricultural systems. The baseline year for crop yield changes is the average yield simulated under current climate (1970-2000 baseline). The resulting yield change data were then fed into trade models to assess impacts on prices and overall food production. (Please note that total production changes need to be treated with caution, since production is determined by many factors.) The overall objective is to calculate quantitative estimates of climate change impacts on the amount of food produced globally, and to determine the consequences to world food prices and the number of people at risk of hunger. This data set is an update to a major crop modeling study by the NASA Goddard Institute for Space Studies (GISS). The initial study was published in 1997, based on output of HadCM2 model forced with greenhouse gas concentration from the IS95 emission scenarios in 1997. Results of the initial study are presented at SEDAC's Potential Impacts of Climate Change on World Food Supply: Data Sets from a Major Crop Modeling Study, released in 2001. The co-authors developed and tested a method for investigating the spatial implications of climate change on crop production. The Decision Support System for Agrotechnology Transfer (DSSAT) dynamic process crop growth models, are specified and validated for one hundred and twenty seven sites in the major world agricultural regions. Results from the crop models, calibrated and validated in the major crop-growing regions, are then used to test functional forms describing the response of yield changes in the climate and environmental conditions. This updated version is based on HadCM3 model output along with GHG concentrations from the Special Report on Emissions Scenarios (SRES). The crop yield estimates incorporate some major improvements: 1) consistent crop simulation methodology and climate change scenarios; 2) weighting of model site results by contribution to regional and national, and rainfed and irrigated production; 3) quantitative foundation for estimation of physiological CO2 effects on crop yields; and 4) Adaptation is explicitly considered. This work links biophysical and statistical models in a rigorous and testable methodology, based on current understanding of processes of crop growth and development. The validated site crop models are useful for simulating the range of conditions under which crops are grown in the world, and provide the means to estimate production functions when experimental field data are not available. The derived functions are appropriate for application in global environmental change studies because they incorporate responses to higher temperatures, changed hydrological regimes, and higher levels of atmospheric CO2. Variables explaining a significant proportion of simulated yield variance in the current climate are crop water (sum of precipitation and irrigation) and temperature during the growing season. Data Set Citation Iglesias, Ana, and Cynthia Rosenzweig. 2010. Effects of Climate Change on Global Food Production under Special Report on Emissions Scenarios (SRES) Emissions and Socioeconomic Scenarios: Data from a Crop Modeling Study. Palisades, NY: Socioeconomic Data and Applications Center (SEDAC), Columbia University. Available at http://sedac.ciesin.columbia.edu/mva/cropclimate/ (date of download) References Parry, M.L., Fischer, C., Livermore, M., Rosenzweig, C., Iglesias, A., 1999. Climate change and world food security: a new assessment. Global Environmental Change 9, 51–67 Parry, M.L., Rosenzweig, C., Iglesias, A., Livermore, M., Fischer, C., 2004. Effect of climate change on global food production under SRES emissions and socio-economic scenarios. Global Environmental Change 14, 53–67 Rosenzweig, C., and A. Iglesias. 2001. Potential Impacts of Climate Change on World Food Supply: Data Sets from a Major Crop Modeling Study, Palisades, NY: Socioeconomic Data and Applications Center, Columbia University. Available at http://sedac.ciesin.columbia.edu/giss_crop_study/index.html Rosenzweig, C., M. L. Parry, G. Fischer, and K. Frohberg. 1993. Climate change and world food supply. Research Report No. 3. Oxford: University of Oxford, Environmental Change Unit. Data Dictionary Data filenamesExampleDescription BLS_2_Countries_(SRES)_ABBREVNAMEAustraliacountry name Fips_codeAScountry code WH_200020,069,730wheat production average 2000 to 2006 in t (FAO) RI_2000891,259rice production average 2000 to 2006 in t (FAO) MZ_2000367,102maize production average 2000 to 2006 in t (FAO) WHA1F20202.668252046wheat yield change (%) from baseline under the SRES A1FI 2020 scenario RIA1F20200.542rice yield change (%) from baseline under the SRES A1FI 2020 scenario MZA1F2020-0.331747954maize yield change (%) from baseline under the SRES A1FI 2020 scenario ActChWHA1F2020535510.992784072wheat total production changes in 2020 applying the SRES A1FI 2020 scenario yield change to the 1990 production ActChRIAIF20204830.6214571428rice total production changes in 2020 applying the SRES A1FI 2020 scenario yield change to the 1990 production ActChMZA1F2020-1217.853848073maize total production changes in 2020 applying the SRES A1FI 2020 scenario yield change to the 1990 production WHA1F20506.2863526447wheat yield change (%) from baseline under the SRES A1FI 2050 scenario RIA1F20506.054rice yield change (%) from baseline under the SRES A1FI 2050 scenario MZA1F2050-0.7136473553maize yield change (%) from baseline under the SRES A1FI 2050 scenario ActChWHA1F20501261654.02957413wheat total production changes in 2050 applying the SRES A1FI scenario yield change to the 1990 production ActChRIAIF205053956.7939142855rice total production changes in 2050 applying the SRES A1FI scenario yield change to the 1990 production ActChMZA1F2050-2619.8147338691maize total production changes in 2050 applying the SRES A1FI scenario yield change to the 1990 production WHA1F2080-0.4360714715wheat yield change (%) from baseline under the SRES A1FI 2080 scenario RIA1F20808.95rice yield change (%) from baseline under the SRES A1FI 2080 scenario MZA1F2080-10.4360714715maize yield change (%) from baseline under the SRES A1FI 2080 scenario ActChWHA1F2080-87518.3688054613wheat total production changes in 2080 applying the SRES A1FI scenario yield change to the 1990 production ActChRIAIF208079767.6421428564rice total production changes in 2080 applying the SRES A1FI scenario yield change to the 1990 production ActChMZA1F2080-38311.0420019704maize total production changes in 2080 applying the SRES A1FI scenario yield change to the 1990 production WHA2a20201.4907169312wheat yield change (%) from baseline under the SRES A2a 2020 scenario RIA2a20200.605rice yield change (%) from baseline under the SRES A2a 2020 scenario MZA2a2020-1.5092830688maize yield change (%) from baseline under the SRES A2a 2020 scenario ActChWHA2a2020299182.869542998wheat total production changes in 2020 applying the SRES A2a 2020 scenario yield change to the 1990 production ActChRIA2a20205392.1143571428rice total production changes in 2020 applying the SRES A2a 2020 scenario yield change to the 1990 production ActChMZA2a2020-5540.6104873799maize total production changes in 2020 applying the SRES A2a 2020 scenario yield change to the 1990 production WHA2a205010.2183002617wheat yield change (%) from baseline under the SRES A2a 2050 scenario RIA2a20504.342rice yield change (%) from baseline under the SRES A2a 2050 scenario MZA2a20503.2183002617maize yield change (%) from baseline under the SRES A2a 2050 scenario ActChWHA2a20502050785.31691502wheat total production changes in 2050 applying the SRES A2a 2050 scenario yield change to the 1990 production ActChRIA2a205038698.4471714284rice total production changes in 2050 applying the SRES A2a 2050 scenario yield change to the 1990 production ActChMZA2a205011814.4492244574maize total production changes in 2050 applying the SRES A2a 2050 scenario yield change to the 1990 production WHA2a20808.5162073366wheat yield change (%) from baseline under the SRES A2a 2080 scenario RIA2a208010.645rice yield change (%) from baseline under the SRES A2a 2080 scenario MZA2a2080-2.4837926634maize yield change (%) from baseline under the SRES A2a 2080 scenario ActChWHA2a20801709179.85518808wheat total production changes in 2080 applying the SRES A2a 2080 scenario yield change to the 1990 production ActChRIA2a208094874.4749285714rice total production changes in 2080 applying the SRES A2a 2080 scenario yield change to the 1990 production ActChMZA2a2080-9118.0560915753maize total production changes in 2080 applying the SRES A2a 2080 scenario yield change to the 1990 production WHA2b20203.0981965771wheat yield change (%) from baseline under the SRES A2b 2020 scenario RIA2b20200.073rice yield change (%) from baseline under the SRES A2b 2020 scenario MZA2b20200.0981965771maize yield change (%) from baseline under the SRES A2b 2020 scenario ActCHWHA2b2020621799.701172225wheat total production changes in 2020 applying the SRES A2b 2020 scenario yield change to the 1990 production ActChRIA2b2020650.6187571428rice total production changes in 2020 applying the SRES A2b 2020 scenario yield change to the 1990 production ActChMZA2b2020360.4817387653maize total production changes in 2020 applying the SRES A2b 2020 scenario yield change to the 1990 production WHA2b20507.2943867124wheat yield change (%) from baseline under the SRES A2b 2050 scenario RIA2b20504.419rice yield change (%) from baseline under the SRES A2b 2050 scenario MZA2b20500.2943867124maize yield change (%) from baseline under the SRES A2b 2050 scenario ActCHWHA2b20501463963.74959067wheat total production changes in 2050 applying the SRES A2b 2050 scenario yield change to the 1990 production ActChRIA2b205039384.7162714284rice total production changes in 2050 applying the SRES A2b 2050 scenario yield change to the 1990 production ActChMZA2b20501080.6999294057maize total production changes in 2050 applying the SRES A2b 2050 scenario yield change to the 1990 production WHA2b20805.3870915198wheat yield change (%) from baseline under the SRES A2b 2080 scenario RIA2b208011.442rice yield change (%) from baseline under the SRES A2b 2080 scenario MZA2b2080-5.6129084802maize yield change (%) from baseline under the SRES A2b 2080 scenario ActChWHA2b20801081174.74596472wheat total production changes in 2080 applying the SRES A2b 2080 scenario yield change to the 1990 production ActChRIA2b2080101977.805742857rice total production changes in 2080 applying the SRES A2b 2080 scenario yield change to the 1990 production ActChMZA2b2080-20605.1073074167maize total production changes in 2080 applying the SRES A2b 2080 scenario yield change to the 1990 production WHA2c20204.9901888601wheat yield change (%) from baseline under the SRES A2c 2020 scenario RIA2c20200.437rice yield change (%) from baseline under the SRES A2c 2020 scenario MZA2c20201.9901888601maize yield change (%) from baseline under the SRES A2c 2020 scenario ActChWHA2c20201001517.45210535wheat total production changes in 2020 applying the SRES A2c 2020 scenario yield change to the 1990 production ActChRIA2c20203894.7999571428rice total production changes in 2020 applying the SRES A2c 2020 scenario yield change to the 1990 production ActChMZA2c20207306.0259524535maize total production changes in 2020 applying the SRES A2c 2020 scenario yield change to the 1990 production WHA2c20508.3291046372wheat yield change (%) from baseline under the SRES A2c 2050 scenario RIA2c20504.986rice yield change (%) from baseline under the SRES A2c 2050 scenario MZA2c20501.3291046372maize yield change (%) from baseline under the SRES A2c 2050 scenario ActChWHA2c20501671628.84780696wheat total production changes in 2050 applying the SRES A2c 2050 scenario yield change to the 1990 production ActChRIA2c205044438.1523714284rice total production changes in 2050 applying the SRES A2c 2050 scenario yield change to the 1990 production ActChMZA2c20504879.1716041079maize total production changes in 2050 applying the SRES A2c 2050 scenario yield change to the 1990 production WHA2c20807.0479007828wheat yield change (%) from baseline under the SRES A2c 2080 scenario RIA2c208010.736rice yield change (%) from baseline under the SRES A2c 2080 scenario MZA2c2080-3.9520992172maize yield change (%) from baseline under the SRES A2c 2080 scenario ActChWHA2c20801414494.68798367wheat total production changes in 2080 applying the SRES A2c 2080 scenario yield change to the 1990 production ActChRIA2c208095685.520228571rice total production changes in 2080 applying the SRES A2c 2080 scenario yield change to the 1990 production ActChMZA2c2080-14508.2409141352maize total production changes in 2080 applying the SRES A2c 2080 scenario yield change to the 1990 production WHB1a2020-0.2408729409wheat yield change (%) from baseline under the SRES B1a 2020 scenario RIB1a2020-0.171rice yield change (%) from baseline under the SRES B1a 2020 scenario MZB1a2020-3.2408729409maize yield change (%) from baseline under the SRES B1a 2020 scenario ActChWHB1a2020-48342.549918506wheat total production changes in 2020 applying the SRES B1a 2020 scenario yield change to the 1990 production ActChRIB1a2020-1524.0521571429rice total production changes in 2020 applying the SRES B1a 2020 scenario yield change to the 1990 production ActChMZB1a2020-11897.3140134036maize total production changes in 2020 applying the SRES B1a 2020 scenario yield change to the 1990 production WHB1a20503.462033802wheat yield change (%) from baseline under the SRES B1a 2050 scenario RIB1a20502.197rice yield change (%) from baseline under the SRES B1a 2050 scenario MZB1a2050-1.537966198maize yield change (%) from baseline under the SRES B1a 2050 scenario ActChWHB1a2050694820.851414053wheat total production changes in 2050 applying the SRES B1a 2050 scenario yield change to the 1990 production ActChRIB1a205019580.9508142856rice total production changes in 2050 applying the SRES B1a 2050 scenario yield change to the 1990 production ActChMZB1a2050-5645.9068691552maize total production changes in 2050 applying the SRES B1a 2050 scenario yield change to the 1990 production WHB1a20804.1633218126wheat yield change (%) from baseline under the SRES B1a 2080 scenario RIB1a20801.16rice yield change (%) from baseline under the SRES B1a 2080 scenario MZB1a2080-1.8366781874maize yield change (%) from baseline under the SRES B1a 2080 scenario ActChWHB1a2080835567.46466224wheat total production changes in 2080 applying the SRES B1a 2080 scenario yield change to the 1990 production ActChRIB1a208010338.5994285712rice total production changes in 2080 applying the SRES B1a 2080 scenario yield change to the 1990 production ActChMZB1a2080-6742.4849833442maize total production changes in 2080 applying the SRES B1a
Answered 4 days AfterNov 30, 2023

Answer To: I attached the instruction file as word file and raw data exceel. XXXXXXXXXXSubmit...

Pratibha answered on Dec 04 2023
32 Votes
Predictive Analysis Project Instructions
Project: Investigate the effect of climate on food supply – 2050 and 2080 on the basis of 2000 and 2020
Questions:
-How historical climate changes impacted food production?( Do-Time Series Analysis)
-How are projected climate changes likely to impact food production in the future?(Do: Regression)
-What are the most vulnerable regions and populations? (Do -Spatial analysis)
-What adaptation and mitigation strategies can be implemented to reduce the risks to food security? Do - logistics regression)
1.Data preparation: How many row and column, and variable. How may you remove to balancing the data. Give Histogram
· Data has 157 variables with 167 observations. I have used a dataset that contains information related to the growth rates of wheat (WH), rice (RI), and maize (MZ) for the years 2000, 2020, 2050, and 2080. The dataset also includes variables such as WHA1F2050, WH_2000, RI_2000, MZ_2000, WHAIF2020, WHAIF2080, RIA1F2020, RIA1F2050, RIA1F2080, MZA1F2020, MZA1F2050, MZA1F2080, BLS_2_Countries_(SRES)_ABBREVNAME, WH%GR, RI%GR, MZ%GR, WH_growth_2020_2080, WHpercentGR, WHB1a2050, WHB1a2080, WHA1F2020, WHA1F2080, WHA1F2050, ActChWHA1F2050, ActChWHA1F2020, ActChWHA1F2080, RI_growth_2020_2080, RIB1a2050, RIB1a2080, RIA1F2020, RIA1F2080, RIA1F2050, ActChRIA1F2050, ActChRIA1F2020, ActChRIA1F2080, MZ_growth_2020_2080, MZpercentGR, MZB1a2050, MZB1a2080, MZA1F2020, MZA1F2080, MZA1F2050, ActChMZA1F2050, ActChMZA1F2020, ActChMZA1F2080.
· The data quality is not too good, and data preprocessing is required. Issues with the data are as follows:
· Missing values
· Incorrect data
types, and
· Variable name issues (for e.g., MG%GR, % is the issue and caused error during modelling)
Data preparation:
· Changed variable names for e.g RI%GR to RipercentGR,
· Ensuring that data types are appropriate for the type of data and analysis is important. Changed datatypes of variables, character to numeric and factor.
· Imputed the missing values by average values of the variables
· Created Variables for growth from the year 2000 to 2080, by using available Variables, and Formulas as shown below:
· # Calculate growth rates for WH, RI, and MZ from 2000 to 2050
df$WH_growth_2000_2050 <- (df$WHA1F2050 - df$WH_2000) / df$WH_2000
df$RI_growth_2000_2050 <- (df$RIA1F2050 - df$RI_2000) / df$RI_2000
df$MZ_growth_2000_2050 <- (df$MZA1F2050 - df$MZ_2000) / df$MZ_2000
· # Calculate growth rates for WH, RI, and MZ from 2020 to 2080
df$WH_growth_2000_2080 <- (df$WHA1F2080 - df$WH_2000) / df$WH_2000
df$RI_growth_2000_2080 <- (df$RIA1F2080 - df$RI_2000) / df$RI_2000
df$MZ_growth_2000_2080 <- (df$MZA1F2080 - df$MZ_2000) / df$MZ_2000
· # Calculate growth rates for WH, RI, and MZ from 2000 to 2050
df$WH_growth_2020_2050 <- (df$WHA1F2050 - df$WHA1F2020) / df$WHA1F2020
df$RI_growth_2020_2050 <- (df$RIA1F2050 - df$RIA1F2020) / df$RIA1F2020
df$MZ_growth_2020_2050 <- (df$MZA1F2050 - df$MZA1F2020) / df$MZA1F2020
· # Calculate growth rates for WH, RI, and MZ from 2020 to 2080
df$WH_growth_2020_2080 <- (df$WHA1F2080 - df$WHA1F2020) / df$WHA1F2020
df$RI_growth_2020_2080 <- (df$RIA1F2080 - df$RIA1F2020) / df$RIA1F2020
df$MZ_growth_2020_2080 <- (df$MZA1F2080 - df$MZA1F2020) / df$MZA1F2020
Histogram:
Histogram of all Variables has been plotted:
Selected Few Variables (Around 15 Variables) and Plotted The histogram
2. Modeling:
Model implementation : Three crops( wheat , Rice, Maize)
A.    Time series
# Plot multiple time series separately
for (i in 1:ncol(data_ts)) {
plot(data_ts[, i], type = 'l', main = colnames(data_ts)[i],
xlab = "Year", ylab = "Value")
}
# Plot the time series data
#plot(data_ts, main = "Time Series Data", xlab = "Year", ylab = "Value")
# Plot the time series data
#plot(data_ts, main = "Wheat, Rice, and Maize Growth Over Time",
# ylab = "Growth", xlab = "Year", col = 1:ncol(df_selected))
# Extract the growth percentage columns for each crop
wheat_column <- df_selected$WHpercentGR
rice_column <- df_selected$RIpercentGR
maize_column <- df_selected$MZpercentGR
# Combine the columns into a matrix or data frame
combined_data <- data.frame(wheat_column, rice_column, maize_column)
# Convert the combined data into a time series
data_ts <- ts(combined_data, start = c(2000),end=c(2080), frequency = 1)
# Plot the time series data
plot(data_ts, main = "Wheat, Rice, and Maize Growth Over Time",
ylab = "Growth", xlab = "Year", col = 1:ncol(combined_data))
# Set hypotheses for each crop
# Hypothesis for Wheat: The wheat growth is expected to increase over time.
# Hypothesis for Rice: The rice growth follows a stable pattern without significant fluctuations.
# Hypothesis for Maize: The maize growth exhibits seasonal variations and an overall increasing trend.
# Fit ARIMA models for each crop (Example with ARIMA(1,0,1) model)
library(forecast)
## Registered S3 method overwritten by 'quantmod':
## method from
## as.zoo.data.frame zoo
# Wheat ARIMA model
wheat_arima <- auto.arima(wheat_column)
summary(wheat_arima)
## Series: wheat_column
## ARIMA(1,0,1) with non-zero mean
##
## Coefficients:
## ar1 ma1 mean
## 0.0217 0.0817 34.9401
## s.e. 0.4892 0.4843 3.3443
##
## sigma^2 = 1549: log likelihood = -843.67
## AIC=1695.35 AICc=1695.6 BIC=1707.8
##
## Training set error measures:
## ME RMSE MAE MPE MAPE MASE ACF1
## Training set -0.0241684 38.99381 35.02552 -Inf Inf 0.9005648 4.855697e-05
# Rice ARIMA model
rice_arima <- auto.arima(rice_column)
summary(rice_arima)
## Series: rice_column
## ARIMA(0,0,0) with non-zero mean
##
## Coefficients:
## mean
## 24.4027
## s.e. 2.6777
##
## sigma^2 = 1197: log likelihood = -823.34
## AIC=1650.69 AICc=1650.76 BIC=1656.91
##
## Training set error measures:
## ME RMSE MAE MPE MAPE MASE ACF1
## Training set -1.210429e-15 34.50007 28.80044 -Inf Inf 0.8783524 0.03113128
# Maize ARIMA model
maize_arima <- auto.arima(maize_column)
summary(maize_arima)
## Series: maize_column
## ARIMA(0,0,0) with non-zero mean
##
## Coefficients:
## mean
## 35.3607
## s.e. 2.6758
##
## sigma^2 = 1196: log likelihood = -823.23
## AIC=1650.45 AICc=1650.52 BIC=1656.67
##
## Training set error measures:
## ME RMSE MAE MPE MAPE MASE ACF1
## Training set 5.966523e-12 34.47548 30.41014 -Inf Inf 0.7650439 -0.05437934
# Forecast for the next 12 months (adjust as needed)
wheat_forecast <- forecast(wheat_arima, h = 12)
rice_forecast <- forecast(rice_arima, h = 12)
maize_forecast <- forecast(maize_arima, h = 12)
# Plot the forecasts
plot(wheat_forecast, main = "Wheat Growth Forecast")
plot(rice_forecast, main = "Rice Growth Forecast")
plot(maize_forecast, main = "Maize Growth Forecast")
B.    Regression
Wheat Analysis:
Wheat Growth Prediction:
Null Hypothesis (H₀): There is no significant linear relationship between various factors and wheat growth.
Alternative Hypothesis (H₁): At least one of the predictor variables has a significant linear relationship with wheat growth.
# Load necessary libraries
library(caret)
df1 <- subset(df, select = c(WH_growth_2000_2050,WH_growth_2020_2080,WH_growth_2000_2080,WH_growth_2020_2050, WHpercentGR, WHB1a2050, WHB1a2080, WHA1F2020, WHA1F2080, WHA1F2050, ActChWHA1F2050, ActChWHA1F2020, ActChWHA1F2080))
df1 <- subset(df, select = c(WH_growth_2020_2080, WHpercentGR, WHB1a2050, WHB1a2080, WHA1F2020, WHA1F2080, WHA1F2050, ActChWHA1F2050, ActChWHA1F2020, ActChWHA1F2080))
missing_values <- colSums(is.na(df1))
print(missing_values)
## WH_growth_2020_2080 WHpercentGR WHB1a2050 WHB1a2080
## 0 0 0 0
## WHA1F2020 WHA1F2080 WHA1F2050 ActChWHA1F2050
## 0 0 0 0
## ActChWHA1F2020 ActChWHA1F2080
## 0 0
# Remove rows with missing values
data_ts <- na.omit(df1)
# Check for infinite values
infinite_values <- apply(df1, 2, function(x) any(is.infinite(x)))
print(infinite_values)
## WH_growth_2020_2080 WHpercentGR WHB1a2050 WHB1a2080
## FALSE FALSE FALSE FALSE
## WHA1F2020 WHA1F2080 WHA1F2050 ActChWHA1F2050
## FALSE FALSE FALSE FALSE
## ActChWHA1F2020 ActChWHA1F2080
## FALSE FALSE
# Remove rows with infinite values
df1 <- df1[is.finite(rowSums(df1)), ]
set.seed(123) # For reproducibility
train_indices <- sample(1:nrow(df1), 0.75 * nrow(df)) # 70% train, 30% test
train_data <- df1[train_indices, ]
test_data <- df1[-train_indices, ]
dim(train_data)
## [1] 124 10
dim(test_data)
## [1] 42 10
# Train the linear regression model
set.seed(123)
wheat_model <- lm(WHpercentGR ~., data = train_data, ntree = 100)
print(wheat_model)
##
## Call:
## lm(formula = WHpercentGR ~ ., data = train_data, ntree = 100)
##
## Coefficients:
## (Intercept) WH_growth_2020_2080 WHB1a2050
## 6.150e+01 2.045e-01 8.334e+00
## WHB1a2080 WHA1F2020 WHA1F2080
## 1.153e+00 1.980e+00 2.299e+00
## WHA1F2050 ActChWHA1F2050 ActChWHA1F2020
## -8.933e+00 2.045e-06 -7.717e-06
## ActChWHA1F2080
## 6.133e-06
Rice Growth Prediction:
Null Hypothesis (H₀): The combined effect of all predictor variables does not significantly impact rice growth.
Alternative Hypothesis (H₁): The combination of at least some of the predictor variables has a significant linear relationship with rice growth.
# Fit the multiple linear regression model
dfRI <- subset(df, select = c(RI_growth_2000_2050, RI_growth_2020_2080, RI_growth_2000_2080, RI_growth_2020_2050, RIpercentGR, RIB1a2050, RIB1a2080, RIA1F2020, RIA1F2080, RIA1F2050, ActChRIAIF2050, ActChRIAIF2020, ActChRIAIF2080))
missing_values <- colSums(is.na(dfRI))
print(missing_values)
## RI_growth_2000_2050 RI_growth_2020_2080 RI_growth_2000_2080 RI_growth_2020_2050
## 0 0 0 0
## RIpercentGR RIB1a2050 RIB1a2080 RIA1F2020
## 0 0 0 0
## RIA1F2080 RIA1F2050 ActChRIAIF2050 ActChRIAIF2020
## 0 0 0 0
## ActChRIAIF2080
## 0
# Remove rows with missing values
dfRI <- na.omit(dfRI)
# Check for infinite values
infinite_values <- apply(dfRI, 2, function(x) any(is.infinite(x)))
print(infinite_values)
## RI_growth_2000_2050 RI_growth_2020_2080 RI_growth_2000_2080 RI_growth_2020_2050
## TRUE FALSE TRUE FALSE
## RIpercentGR RIB1a2050 RIB1a2080 RIA1F2020
## FALSE FALSE FALSE FALSE
## RIA1F2080 RIA1F2050 ActChRIAIF2050 ActChRIAIF2020
## FALSE FALSE FALSE FALSE
## ActChRIAIF2080
## FALSE
# Remove rows with infinite values
dfRI <- dfRI[is.finite(rowSums(dfRI)), ]
set.seed(123) # For reproducibility
train_indices <- sample(1:nrow(dfRI), 0.75 * nrow(df)) # 70% train, 30% test
train_data <- dfRI[train_indices, ]
test_data <- dfRI[-train_indices, ]
dim(train_data)
## [1] 124 13
dim(test_data)
## [1] 40 13
lm_modelRI <- lm(RIpercentGR ~ ., data = train_data)
print(lm_modelRI)
##
## Call:
## lm(formula = RIpercentGR ~ ., data = train_data)
##
## Coefficients:
## (Intercept) RI_growth_2000_2050 RI_growth_2020_2080
## 3.410e+03 3.808e+03 -4.032e-01
## RI_growth_2000_2080 RI_growth_2020_2050 RIB1a2050
## -4.342e+02 -4.026e+00 -8.465e+00
## RIB1a2080 RIA1F2020 RIA1F2080
## 2.625e+00 5.521e+00 -6.881e-01
## RIA1F2050 ActChRIAIF2050 ActChRIAIF2020
## 1.964e+00 7.148e-05 -2.050e-05
## ActChRIAIF2080
## -3.912e-05
Maize Growth Prediction: Null Hypothesis (H₀): There is no significant linear association between factors such as temperature variation, water availability, and maize growth. Alternative Hypothesis (H₁): At least one of the predictor variables shows a significant linear association with maize growth.
dfMZ <- subset(df, select = c(MZ_growth_2000_2050,MZ_growth_2020_2080,MZ_growth_2000_2080,MZ_growth_2020_2050, MZpercentGR, MZB1a2050, MZB1a2080, MZA1F2020, MZA1F2080, MZA1F2050, ActChMZA1F2050, ActChMZA1F2020, ActChMZA1F2080))
missing_values <- colSums(is.na(dfMZ))
print(missing_values)
## MZ_growth_2000_2050 MZ_growth_2020_2080 MZ_growth_2000_2080 MZ_growth_2020_2050
## 0 0 0 0
## MZpercentGR MZB1a2050 MZB1a2080 MZA1F2020
## 0 0 0 0
## MZA1F2080 MZA1F2050 ActChMZA1F2050 ActChMZA1F2020
## 0 0 0 0
## ActChMZA1F2080
## 0
# Remove rows with missing values
dfMZ <- na.omit(dfMZ)
# Check for infinite values
infinite_values <- apply(dfMZ, 2, function(x) any(is.infinite(x)))
print(infinite_values)
## MZ_growth_2000_2050 MZ_growth_2020_2080 MZ_growth_2000_2080 MZ_growth_2020_2050
## FALSE FALSE FALSE FALSE
## MZpercentGR MZB1a2050 MZB1a2080 MZA1F2020
## FALSE FALSE FALSE FALSE
## MZA1F2080 MZA1F2050 ActChMZA1F2050 ActChMZA1F2020
## FALSE FALSE FALSE FALSE
## ActChMZA1F2080
## FALSE
# Remove rows with infinite values
dfMZ <- dfMZ[is.finite(rowSums(dfMZ)), ]
set.seed(123) # For reproducibility
train_indices <- sample(1:nrow(dfMZ), 0.75 * nrow(df)) # 70% train, 30% test
train_data <- dfMZ[train_indices, ]
test_data <- dfMZ[-train_indices, ]
dim(train_data)
## [1] 124 13
dim(test_data)
## [1] 42 13
lm_modelMZ <- lm(MZpercentGR ~ ., data = train_data, ntree = 100)
print(lm_modelMZ)
##
## Call:
## lm(formula = MZpercentGR ~ ., data = train_data, ntree = 100)
##
## Coefficients:
## (Intercept) MZ_growth_2000_2050 MZ_growth_2020_2080
## 1.004e+02 1.900e+02 2.327e-01
## MZ_growth_2000_2080 MZ_growth_2020_2050 MZB1a2050
## -9.374e+01 -4.026e-01 -2.689e+00
## MZB1a2080 MZA1F2020 MZA1F2080
## -6.267e+00 4.601e+00 -1.394e+00
## MZA1F2050 ActChMZA1F2050 ActChMZA1F2020
## 5.583e+00 4.362e-07 -3.708e-06
## ActChMZA1F2080
## -4.672e-07
C.    Spatial Analysis
# Load necessary libraries
library(sf)
## Linking to GEOS 3.9.3, GDAL 3.5.2, PROJ 8.2.1; sf_use_s2() is TRUE
library(ggplot2)
# Filter columns in crop_data
crop_data <- subset(df, select = c("BLS_2_Countries_(SRES)_ABBREVNAME", "Fips_code", "ISO3v10", "MZ_growth_2000_2050", "MZ_growth_2020_2080", "MZ_growth_2000_2080", "MZ_growth_2020_2050", "MZpercentGR"))
# Rename the column in crop_data to match the merging column in world_map
names(crop_data)[names(crop_data) == "BLS_2_Countries_(SRES)_ABBREVNAME"] <- "region"
# Simulated world map (for illustration)
world_map <-...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here