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

K-Means Clustering
Klasterisasi Kecamatan Berdasarkan Karakteristik Wilayah di Lamongan Menggunakan K-Means Clustering
Analisis Regresi Linear Berganda -- Dataset kanker payudarant
Dataset yang digunakan adalah Wisconsin Breast Cancer Dataset yang berisi 569 observasi dengan 30 fitur numerik hasil pengukuran sel tumor payudara. Variabel dependen yang digunakan adalah radius_mean (rata-rata radius tumor), sedangkan variabel independen meliputi texture_mean, smoothness_mean, compactness_mean, dan concavity_mean.
Plot
Plot
Plot
Plot
HW3
To answer the R&D expenditure and firm size analysis task concisely, I first simulate the provided data in R by running the code to create the df_firms dataframe. For visualization, I use ggplot2 to generate a scatter plot of Total_Assets vs. RD_Expenditure, adding a linear trend line to highlight the relationship. In diagnosis, I fit a simple OLS model with lm(RD_Expenditure ~ Total_Assets), then check residuals for normality using a Q-Q plot and Shapiro-Wilk test, and for homoscedasticity with a residuals-vs-fitted plot and Breusch-Pagan test. For transformation, I apply boxcox() from the MASS package on the model to identify the optimal lambda (likely near 0, suggesting a log transform). Finally, I refine by transforming RD_Expenditure based on lambda, re-fit the OLS model, compare summaries and diagnostics (e.g., improved R-squared and test p-values), structure everything in an R Markdown file.
Document