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
1answer
12 views

How do i iterate functions until convergence in R?

I am looking to iterate until convergence but I am not sure how i should code it. A simple similar example is something like $X_0=5 , Y_0=3$ for $n=1,2..$ $P_n=X_{n-1}-Y_{n-1}$ $Y_n=3P_n$ $X_n=P_n+...
0
votes
1answer
18 views

Output model from GLM in R

I had generate in Ra logistic model using glm using binomial as family, but each session that I started in R the variable that I used to store the glm output gives me another output. Why this happen? ...
2
votes
1answer
112 views

how can I replicate working of Multi Label Binarizer from sklearn package in R?

I want to achieve same working of MultiLabelBinarizer from sklearn.preprocessing package in R. I have list of labels for each example (for Predicated and Actual) like below. ...
1
vote
1answer
32 views

Computing adjusted p-values in batches

Data For simplicity I propose the following scheme: I have two DataFrames, one with genes, the other with miRNA (it is a simple example, it is not the case what the DF are), the data are continuous: ...
2
votes
2answers
22 views

Resources for text classification algorithms

I'm mining raw Facebook comments (irrelevant) and i am looking for an algorithm that can classify their context as negative/positive/neutral. So you can think of the output in the form of two columns. ...
1
vote
1answer
10 views
0
votes
0answers
14 views

Using deep learning or statistical tools to complete physical equation

I need to predict a continuous variable Y in a regression setting. Theory in the field tells me it should follow an equation of the form: $$Y=g_0(X)-f_1(X)g_1(X)-f_2(X)g_2(X)$$ Where X is a vector of ...
1
vote
1answer
13 views

Covert R dataframe column to Date

I have a R dataframe having a column with dates in multiple formats. I want to convert this column to date format. While some formats are converted others are not. Why is the second date not converted?...
1
vote
1answer
31 views

R Studio - grepl compare a column in a dataframe to a list of pattern

I have a column named "MATCH" in a dataframe and a list of patterns named "PATTERN". ...
0
votes
0answers
13 views

How to create HTML kind links with text prediction application

I created text prediction application with Shiny.Everything works fine but now I need to output HTML sort of links instead of plain text output,where by clicking on the link of the output can help me ...
0
votes
0answers
15 views

Supervised Text Classification

I need to create a summarized report showing how many containers are being imported by each company. This report needs to be generated on monthly basis. The company names are entered in a way that ...
3
votes
2answers
75 views

How to interpret two continous variables output using GAM?

I am sort of new in R and learning day by day. I really need help with GAM. I have to find out whether association is linear or non-linear by using GAM. The predictor variable is temperature at lag0 ...
0
votes
2answers
729 views

How to split data frame into groups, combine rows

I have a large data set with 405 columns, many rows, and data from 15 sites. Each site has 27 columns, each one one quadrats data. Rows are species data. I would like to split the data into the 15 ...
0
votes
1answer
8 views

What's the best graphic in R to study air pollution?

I have a Python dataframe (in addition to an excel file) with data on air pollution for countries, (one line every day between 2014 and 2020). I would like to see what's the polluant the most related ...
0
votes
1answer
27 views

Reshaping data from long to wide, all dummy variables

I am in the final stages of cleaning data on lobbying. I am trying to reshape my data from long format to wide format. I have two screenshots attached: 1. What it currently looks like. 2. What it ...
0
votes
2answers
19 views

R : Counting the number of observations per category

I'm currently starting out in R and wondering how to count the number of observations per day, per node, per replicate from the below dataset, and store in a different data set. The original dataset ...
24
votes
7answers
6k views

Is Python a viable language to do statistical analysis in?

I originally came from R, but Python seems to be the more common language these days. Ideally, I would do all my coding in Python as the syntax is easier and I've had more real life experience using ...
1
vote
1answer
24 views

Find the mode value and frequency in R

I'm trying to come up with a function in R that gives the mode value of a column along with the number of times (or frequency) that the value occurs. I want it to exclude missing (or blank) values, ...
0
votes
1answer
35 views

R: Rates of change from an initial value

I have a collection of csvs and must produce yearly rates of change per group within each csv, as well as a rate of change compared to the initial value. I am using the function below to calculate ...
1
vote
1answer
41 views

Group_by 2 variables and pivot_wider distribution based on 2 others

Performing some calculations on a dataframe and stuck trying to calculate a few percentages. Trying to append 3 additional columns added for %POS/NEG/NEU. E.g., the sum of amount col for all ...
2
votes
2answers
34 views

How to give breakdown of text prediction sentences in Shiny

I have created a text prediction app that displays 10 sentences based on the word searched in the toolbar. However, all the sentences are being displayed in a single toolbar horizontally. I would like ...
0
votes
1answer
20 views

How to group a unique column and find the mean value in a separate column in R

My table of data looks like this image (but with many more lines): I want to be able to find the mean age of each region, so the mean age for region SSC20790 and so on. I believe I can use the <...
0
votes
1answer
40 views

How to distinguish between normal fluctuation and outliers in ARIMA model?

I have a dataset about sales per day of certain products at the ITEM/DAY/STORE level , I've plotted the series and visually examined it for any outliers, volatility, or irregularities. And this is ...
1
vote
1answer
22 views

Resampling train and test data in R

I need to try out few different machine learning methods (SVM, Logistic regression etc.), predict a value either true or false, and write down their AUC and Accuracy of these predictions. I have ...
5
votes
2answers
94 views

Data visualization with extreme far away points

I want to show points across two groups. However, for both groups, there are some points which are far away from most of the other points within each group, shown below. Any suggestions for this ...
1
vote
0answers
12 views

Factor Analysis with Mixed Data Concurrent Approach with PCAmixdata in R

I am trying to perform Factor Analysis over Mixed Data using R with PCAmixdata package. My dataset is huge with almost 115000 records and almost 40 features of both categorical and continuous. When I ...
2
votes
0answers
27 views

Bag of words: Prediction on new (out-of-sample) data

I'm working with a bag of words in R: library(tm) corpus = VCorpus(textsource) dtm = DocumentTermMatrix(corpus) dtm = as.matrix(dtm) I use the matrix ...
0
votes
0answers
28 views

KNN regression in R

I'm studying a non-linear regression problem and I have read that K-nearest neighbors regression performs well in this case, is there an R implementation of this regression algorithm?
0
votes
2answers
436 views

Running multiple random forest and combining them

I am trying to build a random forest model in R (RStudio). My training dataset has around 2 million rows and 38 variables. When I tested 5000 rows from this dataset I was able to build the random ...
1
vote
1answer
57 views

xgboost in R have different results compared to boosted decision tree in Azure ML

I have a small data set (4000 records with 10 features) and I used XGBOOST in R as well as Boosted Decision Tree model in Azure ML studio. Unfortunately the results are different. I like to optimize ...
0
votes
1answer
292 views

Weighted clustering of lat lon coordinates

I have millions of lat long points that have been grouped into squares. Some squares have thousands of points, others have a couple of points. The idea is that we have one set of lat long for the ...
2
votes
0answers
22 views

Association rules in R / Subset rules based on feature

I tried using the apriori algorithm in the arules library for association rules mining in R. There's two thing I'd like to ask: Why are the lhs and rhs of the rules in intervals? For example U get ...
2
votes
0answers
16 views

User defined aggregations on data of around 200GB where row order matters

I am working with "medium large" data of around 200GB. The data are long form log files, where there are several thousand logs for each "entity". The entities are actually flights ...
0
votes
1answer
42 views

Units of mean decrease accuracy on a variable importance plot obtained from a Random Forests classifier?

To know the importance variable in a Random Forest I used The mean decrease accuracy and mean decrease Gini. I would like to understand what are the x-axis units of the mean decrease accuracy and mean ...
2
votes
1answer
26 views

Linear discriminant analysis in R: how to choose the most suitable model?

The data set vaso in the robustbase library summarizes the vasoconstriction (or not) of subjects’ fingers along with their breathing volumes and rates. ...
0
votes
1answer
15 views

Running a query in R after establishing dbconnect

I do not seem to figure out what is wrong it the following statment. The connection to the DWH is establishe but the query statement in R seems not to work, with the following error : ...
1
vote
1answer
26 views

Random Forest command in R for selected variables

All I can find online is how a random forest is run on all variables in a dataset using the period: ...
0
votes
2answers
34 views

Linear Regression Model

I'm taking a course on Supervised Learning in R: Regression. There is a section where I'm supposed to predict blood pressure given age and weight. This is was MY approach ...
1
vote
1answer
20 views

Memory allocating error with coxph model

I'm working with cox models and as I am adding more variables, I am facing a memory issue. I tried to subset my dataframe by selecting columns which have variables of interest but even then I am ...
2
votes
1answer
25 views

How to split data in R using dplyr if we want to have rows of the same group to belong to the same split?

In my current pipeline, I have sensed that there is data leakage. This is because the same person, though with slightly different values, is in both training and testing set. As a result, my model is ...
0
votes
1answer
653 views

On which algorithm for boosting is the method xgbLinear of the xgboost/caret- package based on?

In caret package of R, there is a method 'xgblinear'. What is the working algorithm behind this method.
0
votes
2answers
28 views

Leave - one - out - Cross Validation KNN R

I have a dataset and I divided it into test data and train data. Can anyone suggest how to perform LOOCV for KNN regression? Is there any library? ...
3
votes
1answer
327 views

k-Nearest Neighbours with time series data - how to obtain whole-time-period estimators

I have a large dataset for the activities performed by multiple staff in a factory over a long period of time - 01/01/2017 - present. The activities performed by different staff are recorded at each ...
1
vote
2answers
69 views

Handling NA Values in the Chicago Crime Rate data set

I am doing a little project on the Chicago Crime Rate data set and I noticed that there are over 600,000 NA values, primarily in the location fields. I feel that ...
0
votes
2answers
17 views

Calculating Median and Mode of numerical variables for different subgroups in R

I have customer call data and I want to get the median and mode for the call success rate for different subgroups. My variables are: Customer ID, Employment Status (Retired, Employed, Unemployed), ...
1
vote
0answers
108 views

reproducible results by set.seed

Is it possible for results to fluctuate a little bit even if I set set.seed? Kindly comment on the degree of freedom allowed or the possible standard deviation from the result set if seeds are fixed? ...
1
vote
1answer
41 views

Classification model to classify large number of classifiers?

Hello I am very new into the field of machine learning/deep learning , and I am finding it hard to select the right model for my research. What I am trying to build is a model to classify which ...
1
vote
2answers
31 views

Calculate regression coefficients for individuals (low sample size regression)?

Is there a way to calculate the regression coefficients for individuals instead of just a group resp. calculating regression coefficients for a very small sample size? Background My goal is to test ...
0
votes
0answers
20 views

E-step for EM algorithm for document clustering

I have a code for the E-step in the EM algorithm for Document Clustering in the version of hard-EM algorithm. I'm trying to implement the E-step for soft-EM algorithm. Here is my code for Hard-EM: <...

1
2 3 4 5
25