RPubs will retire in June 2027. Your existing documents will stay accessible through December 31, 2031
and Connect Cloud is the recommended home for new publishing. Read the blog post

Recently Published

Plot
Plots from regression model, GDP, CPI, and UNRATE
Analyzing Student Depression Using R
Analyzing Student Depression Using R
Document
Statistical learning models are becoming a popular tool used to forecast and analyze Gross Domestic Product (GDP). They use macroeconomic indicators and time series data to improve prediction accuracy. This project will use a linear model to produce results that predict GDP over a 10-year period and compare it with actual results. If successful, it may be helpful for weathering unexpected shocks in the economy. GDP growth rate is perhaps the best indicators of economic growth for a country. It is important to test theories and hypotheses using past data to hopefully get an idea of future trends. Accurate predictions of GDP growth will allow economists and politicians to make better adjustments to monetary and fiscal policy. The biggest challenge/problem is developing accurate models. This project is intended to assist with the many tools already used for determining GDP trends. This project starts with a linear model (LM) and is constructed using the GDP as a response variable. The CPI and Unemployment rate will be used as predictors. Cross-Validation will be used to estimate the accuracy of the test error (model assessment). It will not be an exhausted model for capturing all possibilities within the economic framework, but a functioning statistical learning code with the capacity for adding additional relevant models in the future. The linear regression model showed that unemployment rate is inversely proportionate to GDP (as unemployment goes up, GDP goes down). This was expected; it follows Okun's law. However, the scatter plot revealed a clear nonlinear pattern between them. Therefore, a nonlinear regression method was used, the polynomial regression. A 4-degree polynomial was initial used in the model as a starting point. However, the cross-validation test showed that the best polynomial regression model is with a 2-degree polynomial. The coefficient of determination R^2 method was use to predict the country's Gross Domestic Product (GDP) on the basis of statistical variables associated with its performance, i.e., the unemployment rate (UNRATE), consumer price index (CPI) and certain dates that recorded unexpected shocks in the economy (observation date). The regsubsets function was used to help select variables for the best model. The model with the lowest Bayesian Information Criteria (BIC) is the two variable model that contains CPI and UNRATE. The variables that had the most impact on GDP were CPI and UNRATE. UNRATE and CPI had the least errors in the test, -213.75, 139.27 respectively, indicating they have the most impact on GDP. Of the three variables, observation date had the least impact. This is consistent with real world experiences. For example, during a major economic shock, like in 2020 with Covid and mandatory government shut-downs, the data is radically inconsistent. Aside from rare unforeseen events that result in major economic shocks, seen in the observation date variable, GDP and UNRATE are the indicators most likely to impact GDP.
Document
Dashboard
R Dashboard
botanica
tarea de botanica
Document
Fake News Detection Using Machine Learning
The goal of this project is to develop a machine learning model to classify news articles into categories such as Bias or Conspiracy based on linguistic features, using Text Mining and Machine Learning techniques in R. We will follow a structured pipeline: 1. Data Exploration (EDA) 2. Text Preprocessing 3. TF-IDF Feature Engineering 4. Word Cloud Analysis 5. Sentiment Analysis) 6. Train-Validation-Test Split 7. Model Building(Random Forest and SVM) 8. Model Evaluation 9. Final Model Comparison and Conclusion 10.Future Directions