Questions tagged [r]
R is a free, open-source programming language and software environment for statistical computing, bioinformatics, and graphics.
1,483
questions
0
votes
0
answers
6
views
Is there any way to aquire image and video URLs from a large amount of facebook ads for research?
I have aquired a lot of URLs to some political ads from the Meta ad library API. As far as i can tell, there is no way to automate the aquisation of the image and video URLs from these ads. Is this ...
0
votes
0
answers
18
views
How to optimize hyperparameters of Xgboost algorithm in multiple classes in R?
My unbalanced dataset with 4 classes. there is. I want to use xgboost algorithm for classification. But despite my research I couldn't find how to optimize hyperparameters for multiclass datasets. ...
0
votes
0
answers
6
views
Internal Validation of K-Modes in R
I am wondering if anyone knows of an R library suitable for internal validation of the k-modes algorithm?
Therefore, an R library with silhouette coefficient and other indices suitable for validating ...
0
votes
1
answer
27
views
How can I convert YYYYMM-WN format to YYYYWW format?
I am working on cleaning a time series data that has a weekly frequency. However, the format of the date is a bit convoluted. Here's how it looks like
...
0
votes
0
answers
19
views
Assign clusters to new data using a model based on previously gained data
In an experiment, we gained data through an online survey. We used this data to conduct a cluster analysis (using the library(mclust) library).
According to the ...
0
votes
2
answers
19
views
Which language, tool. package,.. to create a standalone data visualization with interaction
My next task is to create an interface or rather a visualization of signals. Firstly, this is simply the plotting of a few signals, nothing special about that. But one shall be able to zoom in and ...
0
votes
0
answers
19
views
Different results from predict() function and manual calculations of cox model
I have a cox model with variables of age, living environment, Rankin, side of stroke, and systolic blood pressure. Summary of model is:
...
0
votes
0
answers
12
views
Why do you need more subjects than levels in RM ANOVA?
Honestly, I'm hoping I even asked this question appropriately. It's one of those things I never quite grasped, but just accepted to be true, that when running a within-subjects ANOVA, you have to have ...
0
votes
0
answers
9
views
Random Forest - Partial dependence plot/marginal effects
I used the ranger package to train my RF in R. Now I need some more information on the marginal effect and a partial dependence plot but I can't seem to find a good ...
0
votes
0
answers
18
views
Imputing Survival Analysis Data in R
The dataset contains 418 observations and 18 total variables. The two dependent variables are N_Days and Status. The dependent ...
0
votes
1
answer
9
views
R Syntax for converting date to SAS date9 format but the date should be numeric and only format should change
Consider that I have a date i.e. 2017-10-23, and want the result to look 23OCT2017
...
0
votes
0
answers
7
views
Analysis to identify similar occupations by frequency of skills requested in job postings (in R)
I have access to a dataset of job postings, which for each posting has a unique posting ID, the job posting occupation, and a row for each skill requested in each job posting.
The dataset looks a bit ...
1
vote
1
answer
22
views
Random forest - estimate range instead of exact value
I was wondering whether one could adjust a random forest to estimate a range of values instead of receiving one exact estimate. What I mean by that: my current rf predicts a value of e.g. 5 based on ...
0
votes
0
answers
9
views
How perform matrix factorization, having some fixed columns as output?
I would like to perform matrix factorization in R on my data. However, it is a special case and I couldn't find any package to perform what I am looking for. I would be thankful if anybody knows such ...
0
votes
2
answers
40
views
The ideal function in R for fit fitting n LASSO Regressions on n data sets
As part of a statistical learning research paper I am collaborating on, I am running/fitting two hundred sixty thousand different LASSO Regressions on the same number of different randomly generated ...
0
votes
1
answer
48
views
Having problems replicating the results of a series of N LASSOs fit to N datasets in R
I have fit n LASSO Regressions on n different data sets (the 'datasets' object is an R list of length n where each element is a data.table which is a light and fast data frame from the data.table ...
0
votes
0
answers
9
views
Set labels in R summary table
I'm creating a function in R for plotting and calculate an ANOVA model (because I have to repeat this operation a lot of time).
I wrote this function:
...
0
votes
1
answer
28
views
Best package and function in R to use to replicate my (Backward & Forward) Stepwise Regression results I got using step from the stat package
I am doing a research project as a 2nd author on a paper exploring the properties of a novel algorithm for Optimal Variable Selection where I am running the benchmark Variable Selection Methods. Each ...
0
votes
1
answer
24
views
Which specific AWS service to use for running Benchmark Regressions on datasets far too large to run locally on my laptop [closed]
I am in the middle of a research project with a collaborator in which he has proposed a novel statistical learning processor for optimal variable selection, and I am running the 3 Benchmark Variable ...
0
votes
0
answers
14
views
How to add label my stacked bar in R?
How can I add label per sub type?
Is it possible to also add a table below my graph.
With these info?
This is the my current code.
Thank you.
...
0
votes
0
answers
21
views
How to multiply the boolean/binary values in 1 row in a dataframe by the chr values in another row with the product landing in the original row
Suppose that I already know which subset out of a set of 30 candidate regressor columns are the true regressors included in the structural equation describing that dataset (because I do by ...
0
votes
1
answer
61
views
Quantifying the performance of Stepwise Regression ran on Monte Carlo generated datasets & comparing them to your method of interest
The source data files and scripts referenced here and from whom lines of code are included here can be found in my GitHub Repository for this collaborative research project exploring the properties of ...
1
vote
1
answer
13
views
Complex graphical representation based on monthly groups
I'm still fairly new to R, and am having some real issues turning a data frame into a graphical representation.
I downloaded some data for house prices in the UK and stripped it down to just the ...
0
votes
1
answer
35
views
How to run a BE or FS Stepwise Regression on each dataset in a file folder full of datasets using lapply or map (without a loop)
All of the code in this question can be found in my GitHub Repository for this research project on Estimated Exhaustive Regression. Specifically, in the "Both BE & FS script" and "...
0
votes
0
answers
22
views
Substantive differences between using the term "more likely" vs. "higher share" when reporting survey data?
I have a question on proper language to describe differences in survey data. I'm doing some simple descriptive statistics using nationally representative survey data.
I am using svyttest in r to test ...
0
votes
0
answers
15
views
Finding Weekly Inventory from Sold Date and Inventory Added Date
I am aggregating data by week and need to find the number of items in inventory for each week. I have the date sold(Contract Date) and the date the item was added ...
0
votes
1
answer
62
views
How to use 5 different datasets to re-train & test your ML Classification models multiple times
My R scripts and my 5 source datasets can be found in my GitHub Repository for this project, and I originally found this source data on Kaggle. This set of source data includes 5 datasets with over ...
0
votes
1
answer
21
views
Create ML model from dataframe with small number of rows
I have a dataframe with 50 rows (one row for each US state), and about 20 columns with different attributes with state related data. I'm looking to build a linear regression model to predict ...
0
votes
1
answer
108
views
How to assign a random number to multiple columns based on a condition in R?
I have a data frame for an experiment where participants had to answer 5 questions. The system I used for the experiment only reported the results as pass or fail. So basically a score of 1 for ...
0
votes
0
answers
16
views
Can someone suggest good books or resources on SparkR?
I'm trying to find a resource on SparkR specifically so that I can learn about the subtleties in it. But there doesn't seem to be much, other than the docmentation. I found a book called Mastering ...
0
votes
0
answers
21
views
R tabnet package (by torch) need an example of multiclass classification
I'm trying to train a model with three classes but I'm getting terrible results, can anyone show me what I'm doing wrong?
...
0
votes
0
answers
45
views
Forecasting multiple univariate time series using lagged values as predictors
I'm trying to forecast 20 univariate time series using an ensemble of XGBoost, Prophet, Prophet Boost and Random Forests.
As you can imagine, each individual time series have statistically significant ...
0
votes
0
answers
4
views
omnibus test for ARDL model to conduct overall test of the AR effect in residuals?
I have fit an Auto-regressive distributed lag model (ARDL), and am wanting to find an appropriate omnibus test of the residual autoregressive effect. The model fits the outcome variable by including ...
1
vote
1
answer
21
views
Is it possible to extract mathematical expression of an trained ML Model?
In Python & R, Linear Regression model gives the mathematical representation after learning the training data, typically in the form of intercept, coefficients of variables, and the p-value/t-...
0
votes
0
answers
10
views
Data Leakage test - options
I am trying to build a ML model for Churn process but I am probably having data_leaking problems, and I was thinking a way of creating a Test for that.
I was thinking of trying to create a validation ...
1
vote
1
answer
93
views
Two computers, different outputs for same code in R studio
So a classmate and I are working with the same data and code for a problem in a data analysis class. My code for this section looks like this:
...
0
votes
0
answers
27
views
Aggregating variables by two other variables in R using pivot_wider
I have data on cancer case counts in R that I would like to pivot from long to wide, such that a new count variable is created for each five-year age group within race/ethnicity groups. I have tried ...
0
votes
0
answers
10
views
How to turn the fill command into a function of the y-axis value in GGplot (R)
Relative newbie here, and this is my first post...I have tried to make a ggplot bar chart using two methods and have only achieved mixed results with one of the methods. I have created a small sample ...
0
votes
0
answers
60
views
Which hardware setup is better for workstation/server to run R & RStudio on Linux
I have looked up for specs of computers to run R & RStudio and found that Linux (Ubuntu) based machine should be the choice. I talked to a supplier that won a tender at my university for computer ...
0
votes
0
answers
20
views
p-value calculation for Quantile Regression in Python library Statsmodel
How can be the p-values be computed in quantile regression? I can see pre-existing packages in R(quantreg) and Python(statsmodel) arriving at the p-values in Quantile Regression. Kindly provide ...
0
votes
0
answers
25
views
What type of machine learning Is suitable on Arduino to predict anxiety with certain parameters?
I am working on a project that involves the prediction of three different anxiety states according to the galvanic skin response, peripheral skin Temperature and Heart rate (BPM). In order to learn my ...
0
votes
0
answers
19
views
Error in system(cmd, input = filelist, intern = TRUE) : 'zip' not found
I am new to programming, I just learned R. This is the error I'm dealing with Error in system(cmd, input = filelist, intern = TRUE) : 'zip' not found.
This is my code and I am trying to save this file ...
0
votes
0
answers
61
views
reg:gamma in a random forest model in R
It is known that when using a machine learning model using the xgboost algorithm through the boost_tree() function, it is possible to introduce a gamma regression ...
1
vote
0
answers
21
views
Using Fourier Terms and lags in Time Series Forecasting with R
I wish to use Fourier terms as predictors in my XGBoost model.
My date is weekly sales from the timetk::walmart_sales_weekly dataset in R.
To use Fourier terms there are two arguments required in the ...
0
votes
0
answers
12
views
Maximize accuracy with Differential Evolution with R
I am trying to tune gradient boosting (caret package) with differential evolution (DEOptim) in R language. I have a question, is correct to define the maximum of accuracy at each iteration in my eval ...
2
votes
2
answers
74
views
Classification of "good" and "bad" sentences
I have a list of sentences. Examples:
${INS1}, Watch our latest webinar about flu vaccine
Do you think patients would like to go up to 250 days without an attack?
Watch our latest webinar about flu ...
0
votes
0
answers
18
views
Can python's matplotlib render images as quickly as R's Cairo device?
I need to render 100k of plots. I already am doing this quickly enough with R's Cairo device. But I am also considering using python. But, I also already know python's rendering of plots is several ...
2
votes
1
answer
286
views
How to build a model when we have three separate train, validation, and test sets?
I have a data set which should be divided into train, test, and validation sets.
...
0
votes
1
answer
42
views
"Chi-squared approximation may be incorrect" on hypothesis test
I'm doing a hypothesis test to determine if the data follows binomial distribution with p=0.31, and I'm getting a warning when running this:
...
0
votes
1
answer
49
views
How to find the optimal cut-off point to minimize both the FNR and FPR in R?
I should find the optimal threshold to minimize both the false positive rate and false negative rate. An equal weight between these two rates should be assumed. I write the following code:
...