Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

0
votes
0answers
2 views

How to formulate the regression model in R for trials in agriculture over multiple years?

I'm working in a research facility for agriculture where we do a lot of trials that continue over several years. For the example below i tried to find out how to formulate the regression model so ...
0
votes
1answer
34 views

Are my stock returns non-normally distributed?

Hello stats community, I have a Q-Q plot for my stock returns with a sample of n=262. I drew the plot with qqnorm and qqline(qtype=8). Most of the returns, except for 3 outliers, tend to follow the ...
0
votes
1answer
10 views

Any way of holding the other variable constant at mean, not at zero for interaction?

Consider the following example in R: lme4: glmer(score ~ VarA + VarB + VarA:VarB) I'd like to test the main effect of each variable by holding the other ...
0
votes
0answers
24 views

Differences between p values obtained with ANOVA from R packages car and lmerTest

I want to understand the differences between significance (p) values obtained using ANOVA from packages car and lmerTest when evaluating mixed models containing interactions between fixed effects. I'm ...
0
votes
1answer
22 views

lme4: Problems trying to run negative binomial glmer.nb

this is my first post and I am very new to the world of R computing so I hope I have asked everything in the right format, included enough information etc. My data set consists of proportion data for ...
0
votes
0answers
14 views

Bar plot in R showing means and standard deviations of dependent variable with 3 independent variables [migrated]

I am new to using R and wanted to know how to make a bar plot representing the means and standard deviations of my dependent variable which is ingestion rate and have the 3 independent variables also ...
-1
votes
0answers
8 views

How can use UDF function in outside of function [on hold]

I have created UDF Function in R and I want to apply that function in Outside the function, please help me is it possible to do it ?. please explain me to give some example. Thanks Dev
1
vote
0answers
27 views

How to forecast a time series in R with ts() [on hold]

For June 2009 - June 2018, I have prices for product to be delivered that month if bought on the date on the left most column. This below is an excerpt to show the format. The 1-5 and so on r between ...
2
votes
0answers
17 views

Reliability engineering design values from tests AS/NZS1170

To get design values (the strength of something, for example) designing to Australian/ New Zealand loading code you do $n$ tests and estimate the coefficient of variation of your parent population, $...
5
votes
2answers
88 views

Formal definition of the qqline used in a Q-Q plot

I'm doing some distribution fitting work and I'm looking at Q-Q plots and how they can be used visually to interpret goodness of fit. My data is heavy-tailed so I am looking at Weibull, log-normal, ...
-3
votes
0answers
17 views

There are a lot of NAs [on hold]

But it has somewhat different meaning from 0's.(no existence and just number 0.) Should i make other values lower than 0? or give a weighted coefficients?
0
votes
0answers
15 views

Interpreting interacting random effects in lme4

My questions is about how to interpret the output from lme4 for interacting random effects. Our model is as follows: ...
1
vote
1answer
23 views

Help about cosine simulating in h2o

So I'm beginning in deep learning and especially in h2o. I tried to simulate cosine function in R, not to compute it like for example by using h2o.cos(), But after many and many more combinations of ...
0
votes
1answer
19 views

Cox regression - time as covariate

I have fitted a cox regression in R and I am wondering how I can know if a specific time period is associated with more or less death (death is my event in my survival model). I can see it on my ...
0
votes
1answer
45 views

PCA in psych package with more columns than rows

Why is it impossible to do a PCA in R using principal from psych package without warnings with a matrix, which has more columns ...
0
votes
0answers
12 views

Disparate results between functions estimating Variance Inflation Factors

I have been trying to implement the function VIF() from package 'fmsb', and I find that it returns different results compared with the function ...
-1
votes
1answer
42 views

is it allowed to rerun your entire predictive model?

Hi i am new to r and I have made a predictive model for the iris dataset (using the multinom function from the package nnet). When i ran the model for the first time I got an accuracy score 0f 0....
0
votes
0answers
6 views

balance_classes in H2O, but for regression?

I am training with deep learning for regression in H2O for R. My dataset is unbalanced (ie. not evenly distributed). There has been discussion on whether unbalanced datasets are an issue or not, with ...
0
votes
0answers
14 views

Interpretation of Overlapping p-value = 0 and Odss ratio = Inf

I would like to conduct an enrichment analysis between two lists using GeneOverlap package in R. I am comparing gene IDs from each list, and there is no NAs in there. This is the code I'm using: <...
0
votes
0answers
9 views

Regression of cointegrated variables, serial correlation

I have a response variable $Y$ and a series of predictor variables $X_1, X_2, ... X_n$. All are $I(1)$. I found that $Y and X_1, X_2, ... X_n$ are cointegrated. To estimate coeffcients of $Y ~ X_1,...
0
votes
0answers
18 views

Investigating the change of a network / factorial structure over time

I have several variables (questions from a questionnaire) that regroup into several factors (using factor analysis). However, I would be interested in knowing how this factorial structure changes ...
0
votes
0answers
4 views

Should I use hclustvar instead of hclust to transposed data?

I am performing hierarchical clustering to a dataset with X variables (columns) and Y time points (rows) (kind of multivariate time series), where X << Y. I would like to cluster by the ...
-1
votes
0answers
20 views

How to structure python dataframe containing timeseries sensor data for regression modeling? [on hold]

The dataset: I have a dataset containing the data of a manufactoring process. The dataset contains the process ID ("Sarzs_no"), the ID of the manufactoring machine ("Unit"), the data logged by two ...
-2
votes
0answers
11 views

Annual average from monthly data [on hold]

I am new to using R . I have monthly data for rainfall from 1977 to 2017 and I want to find the annual average for each year using 'for' loop and then plot a time series. Any advice on how I could do ...
0
votes
0answers
17 views

I am getting error in arima function of R forecast package for both methods, CSS and ML

Given below are the errors, dataset and code snippet. What do I need to do to run the model? For CSS the error is Error in solve.default(res$hessian * n.used) : Lapack routine dgesv: system ...
0
votes
0answers
22 views

Fitting a Multinomial Logistic Regression model with binary, categorical and continuous predictor variables

I am trying to find out how my dependent variable is influenced by the independent variables. My outcome variable can assume three categories: P(positive), D(doubt) and N(negative). 6 of my predictor ...
1
vote
2answers
33 views

Linear mixed effect model interpretation with log transformed dependent variable

I have a dataset in which the response variable is non normal, but on log transforming, it follows the normal distribution. I constructed a mixed effect model using lme4::lmer() as below (multiple ...
2
votes
0answers
22 views

multi-level Wilcoxon analysis

The question was originated from the paper [1] Table 3 [2], for every species, there was a data frame with two column: disease categories and the conservation index. Conservation index is numeric. The ...
2
votes
1answer
22 views

Reporting betareg outcome - how to compare non-nested models?

I am looking for advice how to gain and report results using beta regression for an ANCOVA-like model. My model is as follows: ...
0
votes
0answers
9 views

How to choose an ordination method for your dataset?

I'm looking for advice on how to choose the correct/best ordination method for my data. My data set: Plant species abundance by plot. Approx 150 plots w/ 40 different plant species. The plots are ...
0
votes
0answers
11 views

Why are there 3 degrees of freedom in a linear model in R? [on hold]

I realized that a linear model in R outputs normally the number of degrees of freedom. But, when I check the the degrees of freedom inside the summary, I get three values. ...
1
vote
1answer
23 views

When to switch off the continuity correction in chisq.test function?

From this Research paper Table1 Association of RAD51-AS1 expression with clinicopathological features of EOC patients I see that p-value is calculated based on Chi-...
0
votes
0answers
18 views

Why after WLS I still get the same result of homoscedasticity tests?

I generated such a sequence x <- seq(1:64) y <- 101 + x + rnorm(64, x, 3*x^(2/3)) df <- data.frame(x, y) then I did the regression and checked for ...
0
votes
0answers
13 views

Post hoc analysis survival data and maximum lifespan survival correction

I every body! Before to present my problem I apologize that I creates the same topic on the forum stackoverflow, but I think the best place for my question was here. I'm a PhD student and I'm ...
1
vote
0answers
20 views

Multinomial (Categorical) Multilevel (Hierarchical) Bayesian Model in R

I have a couple of questions, so I hope it is ok that I ask them here. Before that, here is some background information on my data: Outcome variable (1): categorical, 6 categories, N=168 Predictor ...
0
votes
0answers
15 views

How to perform an exponential regression with multiple variables in r - follow-up [on hold]

I've found the question below and I thought it would answer my similar questions. Can you help explain the role of the highlighted part of the code? I think this is the cause of it not working. <...
0
votes
0answers
31 views

Zaggy Density Plot in R [on hold]

I'm trying one of the examples in the textbook Statistical Rethinking by Richard McElreath. My graph looks wrong: According to the textbook, it is sampling from the posterior & then ...
0
votes
2answers
23 views

How to use equalities as constrains with constrOptim in R

I want to solve a matrix system which have several solutions (infinite since it is overdetermined - 6 equations with 8 unknowns). However, the way I want to do it is to a criterion for the variables, ...
1
vote
0answers
31 views

Equation for standard error of linear predictor and 95% prediction intervals from logistic regression

I would like to present 95% prediction intervals in an online risk calculator. 1) After fitting a logistic model with lrm (which includes some restricted cubic ...
-1
votes
0answers
21 views

Weibull Kernel Evaluation [on hold]

I am trying to evaluate the work of Salha et al. (2014) entitled: "Hazard Rate Function Estimation Using Weibull Kernel" (http://www.m-hikari.com/pms/pms-2014/pms-1-4-2014/ahmedPMS1-4-2014.pdf). They ...
1
vote
1answer
58 views

Interpretation of coefficients from glm Gamma

I am attempting to fit a model to a dataset with frequency (Hz) is the dependent variable. Using a generalized linear model based on a gamma distribution seems appropriate since the values of the ...
2
votes
0answers
19 views

random intercept, random slope plus intercept, no random slope alone?

I measured running speed of 70 individual lizards. The lizards were siblings born of 7 mothers, 10 offspring each. The Lizards ran at 3 different temperatures, A, B, and C, where A < B < C, and ...
0
votes
0answers
3 views

Interpretation and presentation of coefficients for continuous variables in poLCA

I am analysing data on symptoms, signs, and autopsy findings (a set of binary Y/N variables), viral serology, for several viruses, and a few other covariates (Age, gender, site) in pigs. After some ...
0
votes
0answers
29 views
+50

Pettitt's Test for Change-Point Detection Showing P-Value Larger than 1

I am studying how to use the pettitt.test function from the trend package in R to detect change-point in a time-series. However, ...
0
votes
0answers
11 views

Are Multiple Random Intercepts Redundant in This Mixed Model?

I'm curious that is going on behind the scenes when I have two mixed models: s.mod1 = lmer(score ~ (1 + age | state), data=dfScore) and ...
0
votes
0answers
26 views

How to get a regression line where y predicts x? [migrated]

So what the title says. I have two variables and looking to plot both their regression lines on one plot: lm(y ~ x) where x predicts y lm(x ~ y) where y predicts x I figured out how to do the first ...
0
votes
0answers
6 views

Correlation between an ordinal categorical variable and a discrete numerical variable (in R)?

I am confused about which test to use for this particular problem. I have a data set which has questions received from clients and the complexity level the question was assigned by a team member. I ...
0
votes
0answers
12 views

Interpreting odds ratios generated from polr model with both factors and ordinal predictors (Using R) - Note, reposted as user not guest)

I'm working with a large data set of students who have responded to a survey regarding physical activity levels and a number of other measures. I have several models I want to look at to consider the ...
0
votes
0answers
14 views

How do I interpret Principal Components in k-means analysis?

This might not be an appropriate question to make here, but Cross Validated has helped me before so I'll at least try to get help here again. Anyway, here are the relevant parts of the code ...
0
votes
0answers
9 views

Can corrplot be used to construct a correlation matrix with continuous and categorical variables [on hold]

I am working with mmultiple categorical and continuous variables and want to determine potential correlations between them. I have used the 'corrplot' package in R to compute a correlation matrix ...