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
6
votes
1answer
388 views

A clear visualization of a two-way ANOVA

To provide a full yet simple picture of a 3-level, one-way ANOVA, I use the following visualization where variation within each group (the filled circles) and variation between the groups (black ...
0
votes
1answer
15 views

droplevels not dropping anything

I am trying to use droplevels. First I create a subsect of my dataset where the value of attribute Rat must be different from 1 or 5. That value must be a factor. Then, I can see levels are "1", "2", "...
0
votes
1answer
323 views

Importing C4.5 file to R dataframe

I want to convert the input data available as C4.5 file format into a R data frame. The data set can be downloaded from the following link https://archive.ics.uci.edu/ml/machine-learning-databases/...
2
votes
1answer
544 views

Calculate weighted mean for two columns and hundreds of rows?

I'm trying to teach myself basics of R and I couldn't find the answer: Say, I have a csv file and I want to calculate weighted mean for each subject such that I have a mean mu = 0.015*1030+0.16*26930+...
3
votes
1answer
503 views

Why does Caret featurePlot returns returns NULL?

I am trying to use featurePlot of caret in R. This is the code I am using: ...
0
votes
1answer
15 views

Perform bootstrapping of an ordinary linear regression model, using B=100 bootstrap resamples of my dataset, and getting RMSE

So Im studying machine learning through R, and Im working with the boston data set from the library MASS. I am practicing bootsrapping. I already carried out analysis to determine how ,many distinct ...
0
votes
1answer
18 views

Is my bayes classification right or meaningful?

I have this dataset and I am learning about Bayes Classifier. After data cleaning, I have tried to use bayes classifier on it. I used R with this code: ...
0
votes
1answer
67 views

Extract or subset hundreds of columns from a data frame

I need to extract many columns from a dataset. I have a very large csv file with thousands of columns and rows, and I read it into R using: ...
1
vote
1answer
21 views

should we include or exclude a variable in a logistic regression based on the description below?

should we include or exclude a variable in a logit regr. model which will only obtain values if a certain event takes place otherwise will show N/A? this variable tells whether or not a product will ...
1
vote
1answer
149 views

Importing Excel format data into R/R Studio and using glmnet package?

I have no problem importing Excel formatted data into R/R Studio and use all other R packages that I use. But, when I want to use the glmnet package to develop a regularization model, I invariably ...
1
vote
0answers
24 views

What is considered best practice when importing data in a 'pipeline'?

Let's say I have some sort of process that takes data from a CSV that is located on my local machine. This process will eventually need to be scheduled via some cron job. I need to import that data ...
0
votes
2answers
39 views

How to make a dataframe with lists or vectors as its elements

This is something I have been wondering for ages but I am never able to get an answer. I am trying to understand how to make a dataframe in R, where each element of the dataframe is itself a vector ...
1
vote
1answer
50 views

Randomizing selection in R

I am trying to create a comparison group. So far this group contains 45 data points and I need to populate the remaining 55 (for a total of 100 data points). These remaining 55 need to be a ...
1
vote
0answers
41 views

Problem in performing LOOCV

I am trying to run LOOCV on my regression model. I tried to run it in r and encountered the following warning message: ...
1
vote
1answer
41 views

Mirror column plot with different y-axis in ggplot

I am trying to convert this plot Into a mirror column plot I have two datasets: school_purchases recent_school_shootings I am not very experienced with visualisation but this is my approach ...
4
votes
6answers
58k views

How to count observations per ID in R?

I have a large amount of Data where I have to count meassurments per one ID. What I already did was creating a Data Frame over all Files and I omited the NAs. This part works properly. I was wondering ...
0
votes
1answer
39 views

In a Time Series Problem, is it possible to forecast quantities by learning the patterns of other items? What are my options?

Suppose I own a store that sells a variety of apples and I have the following stats each month. Report Date Type of Apple (TA) Quantity Available(QA) Quantity Sold in the Past 30 days(QS30) ...
0
votes
0answers
22 views

Getting an error when reading a graph into R

I am trying to read network data in R using the following code: g = read_graph('dolphins.gml', format = 'gml') This brings up the following error message: ...
1
vote
2answers
39 views

What's my target variable?

I am beginner in data science. I have this "aids" dataset from "mdhglm" package in R. dataset = aids, info = Repatead Measures on AIDS Data ...
1
vote
1answer
916 views

SMOTE for regression

I am looking into upsampling an imbalanced dataset for a regression problem (Numerical target variables) in python. I attached paper and R package that implement SMOTE for regression, can anyone ...
0
votes
1answer
27 views

Is it appropriate to run correlation on continuous y value with discrete x value?

I am dealing with temperature data that are measured in different distances away from the forest edge (0m, 10m,30m,50m,80m) and I would like to find out whether the temperature will drop as the ...
2
votes
1answer
214 views

Missing population values in census data

I have population data from Census.gov: Total US population by age by year from 1940 through 2010 Depending on the range of decades, the data is missing discrete population values for ages greater ...
0
votes
1answer
642 views

Error loading tidyverse in R Studio - No broom package

I'm getting numerous errors when trying to install packages, namely tidyverse and ggplot. The error is of the form are always in the form: ...
0
votes
1answer
107 views

Does Python have R's tidytext equivalent?

I can't seem to find a tidytext (R library) equivalent in Python. Text mining in Python seems quite weak compared to R.
0
votes
1answer
34 views

Merging three different customer segmentation systems into one

I have been given a task where I have three existing customer segmentation systems (rule based e.g. if customer spends X in Y amount of time AND whatever then put in top spender segment is one segment,...
1
vote
1answer
44 views

Relating changes of a value in time to known events

I work with two datasets. The first dataset contains fluor values measured every minute. The second dataset contains certain events and their time. We know that these events cause peaks in fluor ...
1
vote
1answer
27 views

Regime detection to identify transitions between habitats

The following figure represents the concentration of a substance (referred to as Element in the code) measured in an organism throughout its life. There are ...
0
votes
1answer
18 views

How to run a model stored as a .Rda file?

I am using an already written R code which has a line of code as shown below ...
0
votes
0answers
15 views

Same values for PCA Loadings results

I've recently performed a Principle component analysis for my masters thesis where I have 25 network datasets, formatted into graphs and applied 5 measurements to each graph. The measurements were ...
3
votes
1answer
9k views

Plot of ACF & PACF

There are 96 observations of energy consumption per day from 01/05/2016 - 31/05/2017. I am trying an ARIMA model in R to be fitted to these time series observations. I have chosen the frequency of ...
0
votes
0answers
39 views

Multioutput classification: How do I get probabilities of continuous dependent variables?

I'm new to ML and want to try several methods on my data set to compare it and develop a better feeling for the individual approaches. My data set has several independent variables which I want to ...
0
votes
1answer
497 views

faster alternatives to sparse.model.matrix?

I have a large dataset that is entirely categorical. I'm trying to train with it using xgboost, so I must first convert this categorical data to numerical. So far I've been using sparse.model.matrix() ...
0
votes
1answer
544 views

Coloring labels using scatterplot3d in R

I am trying to visualize data using R and scatterplot3d. I have loaded data and used: ...
4
votes
2answers
86 views

Is ARIMA appropriate for time series prediction involving a mix of explanatory and independent variables?

I have a table with the following columns: Date(Month,Year), Sold_Past_Month, Quantity_Available, Quantity_Shipping_In, Missed_Sales, Quantity_Needed Quantity_Needed is the dependent variable that ...
0
votes
0answers
10 views

Plot ROC curves in R conditional on a fixed-effect

I have a model of the form mylogit <- glm(y~x+as.factor(year)+as.factor(city), data=d, family="binomial") How can I plot the ROC curve (or get the ROC score) ...
1
vote
2answers
32 views

Clustering on categorical attributes

I have a dataset with only 2 categorical attributes out of 9. How can I get a clustering analysis on it? I am using R. Do you have any advices about instructions, how to do it, topics, ...? here's my ...
0
votes
0answers
18 views

What is meant by coefficient of determination? Further, is there any difference between r and muliple correlation coefficient?

In the article, Daniel J. Ozer says I demonstrate that D'An￾drade and Dart's conclusion does not require rejecting the variance as a measure of varia￾tion. I describe instead a second model for ...
0
votes
0answers
14 views

PCA and clustering, regression tree with categorical attributes using R

I am trying to analyze a dataset which has 7 categorical attributes out of 9. Can you please help me? I don't know how to find right instructions to do it. I only learnt how to do it with numeric-only ...
0
votes
1answer
25 views

breaking joined words into meaningful ones during text mining

I'm performing an aspect-based sentiment on consumer complaints. I'm tokenizing at the sentence level. ...
4
votes
2answers
688 views

How can I use two different datasets as a training model for svm

I know that you're supposed to scale your test data using the parameters (mean and stdev) from your training data. This is relatively simple; but what if the number of samples is limited in one ...
1
vote
1answer
48 views

Trouble doing a simple Box Plot

This is a problem that I keep having when trying to do a boxplot in R. From what I can see the code I am using should work, not ...
0
votes
1answer
35 views

Test data for statistical t-test in Python

first of all sorry if this is not the proper place to ask but i have been trying to create some dummy variables in order to run a students t-test as well as a welch t-test and then run a monte-carlo ...
3
votes
1answer
40 views

How to calculate events per day in R including dates when no events occurred?

I would like to create a data frame in which in the first column I will have all the dates from a certain period of time and in the second the number of events that occurred on each date including ...
0
votes
2answers
723 views

Fitting an arimax model on out of sample dataset

I have built an arimax model where we have sales data across time as the response variable and price is one of the external variables. I used the below code to build a simple arimax model. I had data ...
0
votes
1answer
30 views

How to create a matrix from two given vectors in R in RStudio?

Suppose, $c(1, 2, 3, 4)$ and $c(2, 4, 5, 6)$ are two vectors. Then in R or RStudio, How to create a $4\times 2$ matrix from these two vectors? Also, how to add another vector $c(8, 9, 10, 11)$ ...
26
votes
10answers
22k views

Any Online R console?

I am looking for an online console for the language R. Like I write the code and the server should execute and provide me with the output. Similar to the website Datacamp.
0
votes
0answers
13 views

Multi input multi output mapping with keras in R

I have five continuous variables I would like to predict ($y_1,...,y_5$). I have some prior belief that these variables are related in such a way that $y_1 \rightarrow y_2 \rightarrow y_3 \rightarrow ...
2
votes
1answer
1k views

R NbClust for Python?

Is somebody know a Python equivalent to R NbClust? I'm searching for a way to determine the optimal clusters number for many 'similar datasets' and NbClust sounds good but it's for R and i'm a Python ...

1 2
3
4 5
25