2022 Developer Survey is open! Take survey.

Questions tagged [r]

R is a free, open-source programming language and software environment for statistical computing, bioinformatics, and graphics.

Filter by
Sorted by
Tagged with
0 votes
0 answers
6 views

classify blocks of time series of unknown section lengths basis slope and smoothed diff

What will be the best approach to classify blocks of a univariate time series that contains data of a fuel tank level (data captured every 30 seconds)? The slope of the curve would be an important ...
user avatar
0 votes
0 answers
16 views

R: Model results in same test accuracy and ROC - How is this possible?

I've trained a simple mlp with my data set (unfortuanetly I cannot share any details): ...
user avatar
0 votes
0 answers
15 views

Do cost-complexity pruned trees perform better relative to unpruned trees?

I came across an adapted question from the famous ISLR book and realise I am unsure of the answer. Does anyone know? Interested in the intuition here! Cost-complexity pruned trees with $\alpha=1$ ...
user avatar
0 votes
0 answers
7 views

why is H2O using only a part of the data?

I have this dataframe: ...
user avatar
  • 480
0 votes
0 answers
11 views

Reduce rows in data frame when computing variable?

Would anyone have an idea as to how I can change this code so that I get to a data frame that only has one row per year? ...
user avatar
0 votes
0 answers
6 views

Do you know any R library to do utility-based regression?

I wanted to know if anyone knew of a library that has utility based regression implemented or someone who knows how to adapt normal regression to utility based regression. I can use either R or python ...
user avatar
  • 320
0 votes
0 answers
7 views

Clustering Using SOM Codebook

I've recently been using the aweSOM R package for cluster visualisation, https://cran.r-project.org/web/packages/aweSOM/vignettes/aweSOM.html. In particular, the aweSOM package entails using ...
user avatar
  • 193
0 votes
1 answer
25 views

Does t-SNE have to result in clear clusters / structures?

I have a data set which, no matter how I tune t-SNE, won't end in clearly separate clusters or even patterns and structures. Ultimately, it results in arbitrary distributed data points all over the ...
user avatar
  • 480
0 votes
2 answers
9 views

Correlations with NA or with Zeros?

When calculating correlations in R e.g. via cor is it better to treat missing data as NAs or as ...
user avatar
  • 480
0 votes
0 answers
19 views

R and Tableau Integration Calculated Field - Mann-Kendall Test

I am trying to detect a monotonic increase or decrease in the rate of ED visits over a 6 month time period (using monthly rates). I would like to see the p-value in the tool-tip when hovering over the ...
user avatar
  • 1
0 votes
0 answers
26 views

R code making 1 column into multiple columns with their unique ID

Currently stuck on a data wrangling question in R. So far I've tried variations of this code using tidyverse package, columns 5 and 6 here were the rating and the user: ...
user avatar
0 votes
1 answer
11 views

Is there a way to forecast a time series multiple linear regression using externally made dummy variables?

This question concerns question 4h of this textbook exercise. It asks to make future predictions based on a chosen TSLM model which involves an endogenously (if i'm using this right) made dummy ...
user avatar
  • 21
1 vote
1 answer
24 views

Many regression lines in a plot

How do you plot many regression lines in a plot? This concerns the textbook question from "Forecasting: Principles and Practice". A dataset concerns winning times of Olympic running events. ...
user avatar
  • 21
1 vote
0 answers
32 views

Learning Python after R [closed]

I just started to learn Python after I worked about 5 years with R. I'm using Spyder as people are recommending this IDE as closest to R and more friendly to Data Science applications. As a ...
user avatar
0 votes
1 answer
16 views

Which statistical analysis to use when you assume non-linear model but not-specified?

I'm a psychology student/researcher and looking to model a phenomenun in which there are 3 variables. The relation of these variables are exactly unclear but I assume these variables are non-linear in ...
user avatar
0 votes
0 answers
6 views

Table from results of sknn function (klaR package) won't output

I have a data set with 6 variables that I'm trying to run the sknn function on and then output a table of the results to show k-NN results. I have updated the response variable to a factor to use as ...
user avatar
0 votes
0 answers
12 views

Regression trees with partykit

I am using the partykit library in order to use regression trees to make predictions. My goal is to create a regression tree that uses binomial as the distribution family parameter. I have been going ...
user avatar
  • 320
0 votes
0 answers
4 views

Whether effect of one categorical variable on a continuous variable depends on levels of another categorical variable

In the dataset I need to analyse, I need to look at whether the effect of people's profession (3 categories) on their scores on a test (I have already tested for this effect and found one) differs ...
user avatar
0 votes
1 answer
30 views

For each unique value in a column, count respective unique values in another column

I have a set of tabular data (e.g. csv) representing accesses to a server through a specific protocol . The data follows this format: ...
user avatar
0 votes
0 answers
17 views

How to cluster the numerous variable with r studio?

How do I cluster the 18 variable with R studio? Should I pair the variable and cluster them? e.g pair Bounce rate and exit rate and cluster, pair visitor type and revenue and cluster. In this data set,...
user avatar
0 votes
0 answers
22 views

Problems with KNN using tidymodels

I am analyzing a database and I want to perform a KNN. I am using the 'tidymodels' library and when I run the model, I get the following error: ...
user avatar
  • 320
0 votes
1 answer
12 views

Multiple conda enviroments in (R) functions using reticulate

For an internally used R package I need to have certain functions load python environments to do part of the processing. The environment cannot be the same one for all functions, unfortunately, due to ...
user avatar
0 votes
0 answers
5 views

Machine Learning Model for Automating Data Cleaning

I have a large file of unstructured help data as below: Hospital Name, Address and Contact Trinity Hospital (123 Main Street) c/o John Smith Island Health Centre, Director: Benson Lee, 1 Pike Road ...
user avatar
  • 1
0 votes
1 answer
12 views

Calculating relative risk in R

I am working with the nhanes data from 2017-2018. I want to determine the relative risk of being overweight (Adipös) when being "Poor". And this grouped by Gender and Ethnicity. So far I ...
user avatar
  • 25
0 votes
0 answers
17 views

Free IDE for enterprise use to program R - any tips?

I recently started working at a company that would benefit from my R programming skills, however, I can't use R-studio because the enterprise edition isn't free. I also gave Jupyter Notebook a shot, ...
user avatar
1 vote
1 answer
25 views

Replacing count by percentage in R

I have the following code : ...
user avatar
  • 25
0 votes
0 answers
20 views

How to convert a string variable containing comments to a variable with integers to be used in neural networks?

I am working with data contains comment variable like imdb data. ...
user avatar
0 votes
0 answers
9 views

How to observe dependencies using ROC curves?

I am dealing with a database in which I am recording the scores that each race has to obtain a credit. I have made the following graphs: [enter image description here]2 Where you can see the relative ...
user avatar
  • 320
0 votes
0 answers
7 views

Transforming /collapsing correlated data to a single independant variable

Is there a technique to collapse correlated data to a single variable? Lets say that the independant variable is the load applied and the dependant variable is the time to failure. When the load is ...
user avatar
  • 1
-1 votes
1 answer
60 views

step-by-step creation of models with accumulation of predictors vs GridSearch

Can you please tell me if step linear models of the independent variable "ols_step_both_p()" (R) are possible with the accumulation of predictors in the amount of 58, 220 and 299, naturally ...
user avatar
0 votes
2 answers
62 views

What does it mean when roc curves intersect at a point?

I am working with a data set and I have obtained the following roc curve: As you can see, black and Asian ethnicity cross at one point (green and purple lines). Does this have any significance? Could ...
user avatar
  • 320
1 vote
0 answers
19 views

How to estimate a best fitting line that separates variables on a scatterplot by some third binary outcome variable with 95% accuracy?

0 I've been thinking about this and haven't found a non-brute force method of doing it. I have a series of scatterplots depicting the relationship between two predictor variables and a third binary ...
user avatar
  • 11
0 votes
1 answer
9 views

How to extract MSEP or RMSEP from lassoCV?

I'm doing lasso and ridge regression in R with the package chemometrics. With ridgeCV it is easy to extract the SEP and MSEP values by ...
user avatar
  • 5
0 votes
0 answers
16 views

How to avoid column names change into valid name format in R

Using dataset <- read.csv(file = 'anything', check.names = FALSE) colnames(dataset) in R, the names are changed into a valid name. (eg. ...
user avatar
  • 101
0 votes
0 answers
29 views

Add an empty row in dataframe with condition using python

i have this 2 datafram and when i compare this 2 datafram i want to add an empty row where the row is in the first one and is not in the second i write this code but is not working for the empty row <...
user avatar
2 votes
1 answer
30 views

PCA dimentional reduction

I try to plot three values of a VCF file (QUAL, DP, and rate of phasing) for all the SNPs in the file. I thought that a PCA plot would be a good way to reduce dimensions of the plot, and to compare ...
user avatar
1 vote
1 answer
20 views

making a contingency table with TRUE and FALSE values

I made the following contingency table already, however there should only be TRUE or FALSE and not all of them showing up on the table. How can I change that? my code is the following: ...
user avatar
  • 25
1 vote
0 answers
13 views

How to add training costs to the variables of a model? [closed]

I am dealing with the Breast Cancer dataset and I want to include costs to the variables, trying to minimize the training costs and maximizing the accuracy. The costs for each variable are as follows <...
user avatar
  • 320
0 votes
1 answer
28 views

Machine learning problem - train and test with different classes

I have a datasets composed like this: library(caret) data <- iris train <- data [1:75,] test <- data[76:150,] So, I have 3 classes in total but: Train: ...
user avatar
  • 411
0 votes
0 answers
37 views

Clustering observations vs clustering features

suppose I want to apply a clustering method of my choice (K-means, hierarchical, ...) to a matrix of observations $X \in \mathbb{R}^{n \times p}$, where $n$ is the number of observations and $p$ the ...
user avatar
0 votes
0 answers
19 views

Interpretation of PCA/FAMD results

I wrote a code about a mix PCA (FAMD - factor analysis of mixed data), where I have a dataset with some categorical variable and some numerical variable. This is my example code in R: ...
user avatar
  • 411
1 vote
0 answers
18 views

How to plot a PCA table [closed]

I'm studying PCA method with the package PCAmixdata because I have a dataset with numerical and categorical variable. This is my example code in R: ...
user avatar
  • 411
1 vote
2 answers
14 views

Doubt about seed setting

I'm doing some data analysis using R and I wrote set.seed(100) at the top of my code. My question is: can I set a random value for the seed? Is there a meaning for ...
user avatar
  • 411
1 vote
1 answer
115 views

Difficulties in create a confusion matrix in R for Yes or No

I am new to regression and confusion matrix and trying to create a confusion matrix from logistic binary regression model. I am trying to create a confusion matrix from Yes or No values from the ...
user avatar
0 votes
0 answers
32 views

PCA analysis graph

I'm trying to draw a graph for a PCA analysis. This is my example R code: ...
user avatar
  • 411
1 vote
1 answer
72 views

Trying to perform elastic-net regression in R

I am new to R and Elastic-Net Regression Model. I am running Elastic-Net Regression Model on the default dataset, titanic. I am trying to obtain the Alpha and Lambda values after running the train ...
user avatar
1 vote
1 answer
29 views

Binary Logistic Regression in R on the dataset, Titanic

I am new to R and Model Learning Algorithm. I am trying to perform Binary Logistic Regression on the training set using the Titanic dataset which is provided by default from R. I am running the ...
user avatar
0 votes
1 answer
32 views

PCA result interpretation

I'm studying PCA and I'm trying to apply this method to mtcars dataset in R. This is my code: ...
user avatar
  • 411
0 votes
0 answers
19 views

Convert a column into row names in an existing data frame

I would like to convert the values in a column of an existing data frame into row names. For example this is the iris dataset: ...
user avatar
  • 411
0 votes
0 answers
20 views

Variables selection to build logistic regression model in R

I want to build a logistic regression model on this df to predict the var12 and I am trying to figure out which variables should I use and with which method.I read that I used calculate the p-value ...
user avatar
  • 1

1
2 3 4 5
29