Use this tag for any *on-topic* question that (a) involves `R` either as a critical part of the question or expected answer, & (b) is not *just* about how to use `R`.

learn more… | top users | synonyms

0
votes
2answers
42 views

What is lm() compared to VAR()

What's the difference between # Fit Model # fit1 = lm(var$1 ~ var$2, data=data) and ...
1
vote
1answer
23 views

Discrepancy between metafor (rma.mv) and metaSEM (meta3) estimates for multilevel meta-analysis

I'm wondering why I get slightly different estimates for a meta-analyzed set of effect sizes, when using the rma.mv function from the metafor package, compared to the meta3 function from the metaSEM ...
2
votes
1answer
40 views

Linear regression polynom slope constraint in R

My problem is how to find best decreasing 3rd degree polynomial regression in R. I have data, lets say ...
0
votes
0answers
10 views

Finding common, evenly present theme (words) across documents

I have a collection of six documents, each of which is a bag of words (not sentences, just words) that describes a certain category of product. I'm trying to figure out the common binding "theme" ...
0
votes
0answers
7 views

Error when trying to store x2-x1 because of length [closed]

I'm new to R; this much will be obvious. I have a column DATA$date_time (ymd_hms form, output from lubridate). I want to create another column that uses difftime to subtract x2-x1 (loop) from within ...
0
votes
1answer
58 views

ANCOVA interpretation – inconsistency between ANOVA results and pairwise group comparisons

I have some measurements (concentration) made in 4 groups (W, X, Y, Z) and time is my covariate. I make a linear model: ...
0
votes
1answer
21 views

R e1071 SVM always gives me (in average) below changes cross validation accuracy with random data

I am running e1071 linear SVM on my neuroimaging data. ( by function svm() ) When I was doing permutation tests, I found, in average, the cross validation (CV) accuracies with shuffle labels were ...
-4
votes
1answer
43 views

Why does a p-value of 2.4 indicate a very small probability that rejecting H0 is incorrect?

I am working with body temperatures in R, conducting a t-test. It is widely believed that the average body temperature for healthy adults is 98.6 degrees Fahrenheit. The body temperatures of $n = ...
2
votes
1answer
40 views
0
votes
0answers
17 views

Errors messages using tables package in R [closed]

Using the tables package in R, I encounter the following error message: ...
3
votes
0answers
74 views
+100

Will Tukey multiple comparison be the same for different types of Sum Of Squares of ANOVA for an unbalanced design

I am working on Two-Way ANOVA for an unbalanced design. Will Tukey multiple comparison be the same for different types (I, II & III) of Sum Of Squares of ANOVA for an unbalanced design. I am ...
0
votes
0answers
20 views

Factors for binary variables [closed]

Is it necessary to convert binary variables to factors? Or should I do it only if I have categorical (>2 levels) vars? Also, does it depend on whether a binary variable is a predictor or a response ...
1
vote
0answers
29 views

Randomly generating transition probabilities for Markov chains

I'm trying to simulate a person moving through a household using a Markov chain. Each state would be a room in the house. The issue I'm running into is that I have no existing data telling me what a ...
0
votes
0answers
3 views

Extracting coefficients from frailty survival model with sparse=T [migrated]

I am fitting a survival model in R with time-dependent covariates and using frailty.gaussian() for some of the variables. An example call is ...
3
votes
1answer
33 views

Is it advisable to include variables that are not in the full model in the imputation model?

I have a dataset with several missing values. I know that the missing is MNAR. I'm trying to use MICE to impute the data; then apply a survival model on the imputed data. The MICE paper advises that ...
0
votes
0answers
3 views

Stacking time series data vertically [migrated]

I am struggling with manipulation of time series data. The dataset has first Column containing information about time points of data collection, 2nd column onwards contains data from different studies....
0
votes
0answers
4 views

Simulating from normal copula in R with varying correlation matrices [migrated]

I'm trying to simulate correlated normal copula realizations using the copula package in R. I have estimated the varying correlation matrices and stored them in an ...
1
vote
0answers
13 views

What to do if my -log(-log(S(t|x))) kaplan-meier survival function violates PH assumption?

I've already performed survdiff() on my survival curves to find that there is a difference in time-to-germination between my 3 treatments. As far as I'm aware, I will need to run coxph() to be able to ...
0
votes
0answers
9 views

TF-IDF between two different datasets in R [closed]

I have two different datasets: one containing a product id and a query(text) and another contaning a product id and a product title. I want to calculate the tf-IDF between each of the queries and the ...
0
votes
0answers
56 views

Finding MLE by R code [closed]

I would like to find the maximum likelihood estimation (MLE) of the parameters of following distribution and desnity function : ...
0
votes
0answers
33 views

What is maximum likelihood estimation in logistic regression? [duplicate]

Can you please explain in simple way. Is it so important in logistic regression?
0
votes
0answers
26 views

How do I predict original components from PCA analysis?

I have the following dataframe ...
0
votes
0answers
24 views

Identifying statistically significant categorical variables with rma.mv

I'm running a meta-regression/multi-level analysis that contains only categorical variables. The printout of the data is as follows: res.fe ...
0
votes
0answers
2 views

Randomly delete/replacing X% of the data using R (or other tool) [closed]

I am quite new to R other statistical tools. In order to measure the performance of an imputation technique, I want to randomly delete or replacing X% of the data so I can compare it with the original ...
1
vote
0answers
19 views

Why do loadings of princomp in R report identical proportion of variance for all principal components? [duplicate]

I'm trying to run a few tests using princomp in R. In princomp there is a value called <...
0
votes
0answers
24 views

How do I find the standard error of the estimate when using S estimation?

How do I find the standard error of the estimate when using S estimation? ...
1
vote
1answer
26 views

CFA: negative factor loadings

I found that after running a CFA, positive factor loadings and negative factor loadings occurred as appropriate. (An item representing a high score and an item representing a low score on the same ...
0
votes
0answers
35 views

Logistic regression Effect using R, moderation plot

So, im in a bit of trouble here. I am using R (i'm very new at this), and i'm trying to plot the probability effects of a interaction effect, using the effects package. This is what the plot shows ...
0
votes
2answers
32 views

Comparing huge data sets that are non-normal and different lengths in R

I'm comparing two data sets. Each set is extremely large, about 25,000 quantitative pieces of data in length. I want to find if these sets are significantly different, but the problem is that they are ...
0
votes
0answers
26 views

Interpreting coxph output with cumulative time dependent covariate

Hoping for some help in interpreting the coxph output in R using the survival package. I am very new to R, but have successfully ...
0
votes
0answers
10 views

Roisson IV in R [closed]

Is there a package in R which implements an IV regression for poisson distributed outcomes (i.e. discrete dependent vars/count data)? Similar to the Stata package here.
3
votes
1answer
60 views

stl() gives seasonal component, but ets() and auto.arima() choose nonseasonal models

I'm completely new to forecasting so please correct me if I'm wrong. I'm trying to forecast sales data using R. My main concern is that when I decompose the data using ...
2
votes
0answers
19 views

Sensitivity Analysis for Missing Not at Random (MNAR) data

I currently have a dataset which contains variables with different degrees of missingingness. One of the key variables for my analysis has about 12% of the values Missing Not at Random (MNAR). From ...
-1
votes
0answers
16 views

Deciding Minbucket size in R

What is the criteria for selecting minbucket size in CART in R? Is there any formula for choosing this, based on the number of observations?
0
votes
0answers
23 views

Convert object output in console to string in R [closed]

Consider the following R program ...
2
votes
1answer
14 views
1
vote
0answers
46 views

R-Monte Carlo simulations for ARMA model [closed]

I have 5 years of daily price data of an asset for which I have fitted an ARMA model. I want to generate 10000 simulations for next 6 months using the last available value for the asset as starting ...
0
votes
0answers
13 views

How can I write an R script to check for straight-lining; i.e., whether, for any given row, all values in a set of columns have the same value [migrated]

I would like to create a dichotomous variable that tells me whether a participant gave the same response to each of 10 questions. Each row is a participant and I want to write a simple script to ...
2
votes
0answers
19 views

R - Weighted Euclidean distance function [closed]

Does a Weighted Euclidean distance function already exists in R ?
3
votes
0answers
44 views

Big difference of accuracy between C-SVC and nu-SVC using SVM

I'm currently dealing with an image classification problems. The objective is to classify the images to 4 classes, with 8000 images in the training set and 14000 images to predict. I'm using the SVM ...
1
vote
0answers
36 views

Linear Mixed Effects Models - combining coefficients

Suppose I have a sample of height data for a population with sex and region identifiers. Now, suppose I estimated the linear mixed model against a variable $x$. I'm using the ...
1
vote
0answers
19 views

how to plot a binomial glmer with two binomial predictors?

I have a response variable called Percieved Personality (responsible-sympathetic) predicted by Birth Order (Firstborn-Laterborn) interacting with Sex (Male-Female), with 2 random effects. I just want ...
1
vote
0answers
74 views

Why does the post-hoc results in R differs the post-hoc results in SPSS?

I have run the same two-way Repeated Measure ANOVA in R and in SPSS. Following that I ran a Fisher's Least Significant Difference (LSD). R script ...
1
vote
0answers
39 views

Cheminformatics in R v Python [closed]

I have a process that will produce Cheminformatics models"CM" in R. The process is designed to produce the optimal subspace for a given dataset. It looks like Python will run faster with large ...
1
vote
1answer
10 views

fitting a logarithmic model

I fit a linear model to my data using lm(y ~ 1 + x1 + x2 + x3 + x4 + x5 + x6 + x7) and I would now like to investigate whether a logarithmic model would fit ...
0
votes
0answers
18 views

Raster time series smoothing

I'm searching for an R package to raster time series smoothing. Currently, I'm using an approach like this one (using the equation suggested by Hamunyella et al., 2013) ...
0
votes
0answers
37 views

Metrics to account for change in fire sizes

I am looking for a mathematical expression that accounts for the change in size of paired fires. Ie. there are thousands of fires, all paired (ie. two separate simulations have been run, and each fire ...
1
vote
1answer
89 views

Data Comparison in R [closed]

I have to compare two data sets to make sure that they are identical. They are massive data sets with millions of data points. Is this possible in R and if so how would I go about that? I am brand new ...
0
votes
0answers
20 views

Specifying the initial values of likfit function of geodata in R

I have a geostatistical data. For analysis, I am using geoR. I want to estimate the parameters. But likfit or ...
0
votes
0answers
30 views

'Lumpable states' analysis for a large transition matrix

I have a large transition matrix, whereby I calculate n-step state distribution results for n=1..10, and then merge states of interest for each ...