Questions tagged [r]

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`.

Filter by
Sorted by
Tagged with
1
vote
0answers
13 views

How can I do meta-regression with an explanatory variable and grouping data according to a categorical variable?

I have been doing meta-regression in r for effect size with explanatory variable as distance but I want it to do it in different habitats which is a categorical variable. My data looks something like ...
1
vote
1answer
19 views

Generating a full rank model matrix in R

For a particular tool I need a model matrix which allows me to build desired contrasts and which is a full rank, i.e. no columns are linear combinations of other columns. The experimental design ...
0
votes
0answers
17 views

Best value to use as component cutoff using mclust in R?

I am working with a dataset of volumes that I have classified into components using the mclust package in R. (univariate, unequal variance). I am now looking for the best way to determine cutoff ...
0
votes
0answers
7 views

Are QAP regression estimates standardized? [closed]

When running a QAP regression through the netlm function in R (sna package), Are the estimates standardized or not? Is there a ...
0
votes
0answers
13 views

How to access to members of a test result in R [migrated]

I am conducting the Levene's test as well as Shapiro-Wilk test on a large set of data. I am wondering how do I access to particular parts of a result and store them in a CSV file to simplify reporting ...
0
votes
0answers
15 views

SVM classification result interpretation

I have created a few SVM classifications for my data but after using polydot with a few different degrees I now have some questions. I ran one SVM using the e1071 package and got an accuracy of ~65%....
0
votes
0answers
11 views

Are there assumptions for using the regsubsets function in R?

I'm doing a multiple linear regression with 24 independent variables. I don't need to check the OLS assumptions because I'm only interested in R^2 that each variable explains. To get a smaller model I ...
0
votes
0answers
5 views

Losing projection information in rasters written in raster package in R [closed]

I am using the 'raster' package to mask, merge, complete focal statistics, and write rasters in R. The native projection of my data is USA_Contiguous_Albers_Equal_Area_Conic_USGS_version, ...
0
votes
1answer
21 views

Suitable machine learning methods for failure detection in a technical system

I'm interested in data analysis and machine learning and have taken some online courses about "R" and "statistical data analysis" so far. So I would consider myself maybe as an advanced beginner. Now ...
1
vote
1answer
16 views

How to run a restricted regression model? [closed]

How can someone run a restricetd Ols or Gmm model in R, that is a zero intercept? Which is the command?
0
votes
0answers
9 views

How to do probabilistic forecasting in R? [closed]

I am a beginner to probabilistic forecasting. From my research I have a vague idea that monte carlo simulation can be done for injecting uncertainity in the process. Do i need to get multiple point ...
2
votes
0answers
17 views

How to analyse the effectiveness of mitigation methods on biological data and variables

I work in wildlife biology. For a project I am attempting, I am looking for a way to assess the effectiveness of various mitigation measures using to protect specific target species. I have a database ...
1
vote
1answer
26 views

GAMM factor-smooth interaction error

I am using gam from the mgcv package to model the effects of climate on the size of small lakes. I have data from 70 lakes ...
1
vote
0answers
13 views

Transfer Function in Dynamic Linear Model to Quantify Intervention Effect?

I have a time series consisting of 48 quarterly observations, relating to the area of land that was subject to development. I am trying to investigate whether a change in policy after 2011 caused an ...
0
votes
0answers
19 views

Calculating sample size required to test (power?) of tool

I have a tool that is designed to help people solve a puzzle. I want to see how good it is at helping people to do this. I thought I would start with taking a group of people and getting them to test ...
0
votes
0answers
14 views

Parameter estimation for power simulation in R without pilot data

I am planning to do a power simulation in R using the simR package. My hypothesized model is y ~ treat1 + treat2*treat3 + (treat2|id) +(1|item). The parameters for <...
0
votes
0answers
9 views

Power analysis for RSA (representational similarity analysis)?

I submitted my paper to a journal and the editor asked me to report the smallest possible effect size that can be detected with my sample size (two matched groups, 31 participants in each group). one ...
-2
votes
0answers
18 views

Finding the MLE of Binomial population in R? [closed]

Draw 1,000 iid samples from a Binomial(k,.2) population, where k ≥ 100 is a number you love! With the help of R, find MLE(k)
1
vote
0answers
18 views

Error using cor.test() but not from cor() in R

Running cor() and cor.test() gives me the same p-value in R but cor.test() also throws a ...
0
votes
0answers
19 views

How do I perform and interpret an Ancova/Poisson Regression, with multiple covariates and possible interactions?

I am researching how recovery time of trees after tropical wildfires differs between South America, Africa and Australia, using R. For this, I am using a Poisson regression. First I checked if there ...
2
votes
0answers
17 views

Where did I go wrong when using ARMAacf function in R? [closed]

I recently had an exam in forecasting where I was one point short of an A. The biggest mistake I made which cost me 3 points was that I incorrectly used the ARMAacf() function to calculate the implied ...
1
vote
0answers
23 views

Testing for homoscedasticity using the Breusch Pagan Test

I am trying to figure out how to test for homoscedasticity. But run into a small issue. I am using this r-bloggers article as a learning resource. According to this article there is no ...
1
vote
0answers
11 views

How do I handle missings with Full Information Maximum Likelihood in R?

I'm using R to perform a hierarchical multiple regression. To handle the missing values in my dataset, I'm supposed to use the Full Information Maximum Likelihood technique. I already looked at dozens ...
0
votes
2answers
33 views

(resolved) R: Clarification fisher.test (idem with chisq.test): Different p-values although same sample size, same proportion difference

I would appreciate so much if someone could help me to understand the following comparisons, and tell me if I am doing the tests correctly. I want to compare two districts and their respective ...
0
votes
0answers
11 views

Bootstrapping a RMSE

I am trying to compute a bootstrapped distribution of the root mean squared errors to 1 of a distribution "A". However, I am not sure how to do this. My approach was to resample the distribution "A" ...
0
votes
0answers
12 views

Finding abnormal behavior in costs in R

I have a dataset with 70 000 observations and 5 variables, x1,x2,...x5 were: x1 = cost, ...
0
votes
0answers
20 views

Using a confidence interval of 90%, what is the fewest and largest number of heads expected in general, if a fair coin is tossed 25 times? [closed]

i am new to r and came across this question and dont know how to approach it. code i came up with is: ...
0
votes
1answer
25 views

Full logistic regression model in r [closed]

I need to create logistic regression model with event binomial variable as dependent variable and Intercept and ...
0
votes
0answers
8 views

Does it make sense to find the confidence interval of an estimate from a regression equation with the actual value? [closed]

I wanted to know if it made sense to find the confidence interval when there is only two numbers in the dataset. One number is the output of a regression equation and the other is the actual value ...
0
votes
1answer
5 views

help reading the confusion matrix of the randomForest function in R, which are the predicted values on the confusion matrix of randomForest function?

Can someone tell me which are the actual values and which are the predicted values on the confusion matrix of randomForest function?
0
votes
0answers
13 views

linear regression scatter plot

I mm investigating a linear relationship between two variables in R. Does the below image look linear or should it be transformed? When I do a log transform it looks pretty much the same. Any ...
0
votes
0answers
19 views

Can I use a GLM to measure changes over time? (R help)

I'm running an experiment in which I'm measuring the changes in DNA concentration over time (response variable), and my predictor variable is temperature. I have three different experiments, with ...
0
votes
0answers
9 views

How can I determine which variable to remove in a GLM with small sample size so that the model runs?

I'm trying to see the isolated and combined effects of precipitation and three different human disturbances indexes are having an effect on the growth of a cactus. I have a gradient of eight different ...
1
vote
0answers
11 views

Interpreting GLM with poisson distribution outputs for assessing affect of two categorical variables on frequency

I'm currently trying to see if the frequency of a behaviour measured in a binary format (yes/no (where yes means the behaviour is present) is related to 1. the month in which behaviour took place and ...
1
vote
0answers
18 views

Models have high accuracy but very low AUC PR curve

I'm doing balanced (70%-30%) binary classification (yes/no) I'm trying to combine caret train objects with PRROC's pr.curve function. I'm using a confusion matrix to determine which class is labelled ...
0
votes
0answers
16 views

Statistical analysis. Help fitting 2 stage or hurdle model on Zero inflated semi-continuous data

Here is a link to My data drive.google.com/open?id=1rDEciVwTVWs3TlVV_hi4WNalEt6cjVHY I'm trying to model cpue (response variable) and tell whether any of the explanatory variables have a significant ...
0
votes
0answers
8 views

Weighted least squares using poisson regression link-log example in R

I'm studying about “weighted least squares” using poisson regression example. And I could got it for poisson link “identity” as following. it would be well because of the same one to minimize (or ...
0
votes
0answers
12 views

ARIMA with xreg forecasting [closed]

Hi I am currently working on a project and I have to create a model to forecast the Probability of Default of a person given the different macroeconomic variables Example: inflation, gdp, exchange ...
0
votes
0answers
23 views

How can I fix the output of a GLM that only gave me “NA” in R Studio?

I'm trying to see the isolated and combined effects of precipitation and three different human disturbances indexes are having an effect on the growth of a cactus. I have a gradient of eight different ...
1
vote
1answer
11 views

What is the confidence interval formula that RMISC package in R uses? [closed]

I tried figuring out the formula that the RMISC package uses but I wasn't sure, I couldn't find the documentation on it? I tried using the t, and Z statistic but it wasn't giving me the same answer as ...
0
votes
1answer
32 views

Finding the best univariate model

I have the response variable as Profit, and several predictor variables. I have made a multivariate linear model to represent this, and have also made univariate models for every individual predictor ...
1
vote
0answers
25 views

longitudinal analysis: a cluster switched from control to treatment in R

I have a longitudinal dataset (see below). Up to year 1, $8$ schools ($4$ in Treatment, $4$ in Control) stayed in the study. But in year ...
1
vote
0answers
25 views

Doubts about the use of Cross-Validation in GLMM

I've recently ask in statckoverflow about some doubts with logistic regression fitted with a GLMM and an user recommend me asking in this forum. So, here it goes. I work with a wild population of a ...
0
votes
0answers
14 views

How to read Biplot of PCA in R

I follow the tutorial about PCA from Here Biplot: R output include principal component from wine data set: In the part of Loadings Wine has 0.62 loading to the 1st principal and nearly zero loading ...
0
votes
1answer
27 views

K-fold cross validation for GLMM

hope all of you are safe during these pandemic scenario. I would describe my case so you can get a better understatement of my question. I work with a wild population of a bird species in which we ...
0
votes
0answers
11 views

Logistic regression: Controlling for unequal distribution in categorical variable

My question title is poorly worded but I hope I can explain my problem here. I have a dataset that contains a binary outcome variable (RP), which I would like to predict using two categorical ...
1
vote
1answer
28 views

With two different random seeds for binary classification, I have the exact same result for GLM and QDA, what gives?

With a binary classification analysis, I find myself with the exact same accuracy, recall and specificity for both a qda and glm model. When I apply the same random seed to both classification ...
0
votes
0answers
8 views

How to construct Forest plot from dataframe containing HR and CI [closed]

0 I have a data of cox regression from spss containing following columns. I am thinking to use this data as dataframe in R and create a forest plot out of it. How can i create a forest plot from this ...
0
votes
0answers
37 views

How do I know if my GLM using selection of models by Akaike Information Criterion is ok?

I'm trying to see the isolated and combined effects of precipitation and three different human disturbances indexes are having an effect on the growth of a cactus. I have a gradient of eight different ...
1
vote
0answers
19 views

Converting data from exponential model to a linear model

This question came up recently and I am really struggling to understand how to even do this. I have just started learning statistics and would like is someone could show me how this could be done in R....