r

  1. R

    Test Durbin Watson(error independence)

    Hello, I am solving an example of Design of experiments of a variable (DCA). It turns out that, on having applied logarithmic transformations, durbin watson throws a similar value, being the different graph library(lmtest) tb = data.frame("treat" = factor(x = c(rep(1:5, c(4,4,4,4,4)), labels...
  2. R

    how to create a portfolio using xts time series

    Hello, I have already corrected the stationary of my elements with diff, but to analyze the VaR (), CVaR (). It is necessary to create a portfolio, I have seen many packages that have left me confused. How is the procedure to create a crypto portfolio? that is I must assign all the columns of...
  3. M

    Lagged values in a LASSO regression

    Hi all, While working on the statistics for my thesis, I became confused while building up my model. I am currently working on a forecasting model with the use of a LASSO regression. The model is build as follows: the unemployment rate is the dependent variable and as exogenous variables I...
  4. R

    How to deal with non-proportional hazard Cox models?

    Dear all, I want to run a Cox model to see if there is an interaction between two treatments. However, the test to see if proportional hazard is respected suggests that it is actually not respected. So I don't know what other statistical survival analysis to do because it means I cannot rely on...
  5. R

    R: Survival and censored data: how structure my input datasheet?

    Dear all, I would like to know how to organize the datasheet to import in R for survival analysis (Surv object, logrank test and Coxph). Let's consider an experiment with small animals. A cohort of 600 individuals is being followed-up every two days for 6 days (so I have data at day=0, 2, 4...
  6. S

    Logistic regression for factorial design: interaction and main effects of treatments

    Hi, This is my first post here. I'm hoping to get some help/feedback for the following hypothetical problem: I have a factorial experimental design with 4 groups: (1) Controls, (2) Treatment A, (3) Treatment B, and (4) Both treatments A and B. A total of 100 patients were randomly allocated in...
  7. I

    Independent, non-normal, unbalanced, analysis of an interaction effect

    I have previously used straightforward two-way ANOVAs for comparing bone density across sport disciplines. I have males (M) and females (F) across low impact (LI) and high impact (HI) sports (N = 92). I have 24 males and females in in the LI group, 19 females in the HI group, but 39 males in the...
  8. A

    Am I dealing with outliers, or something else (skewness of 106)?

    So I have not exactly a homework problem, but I just discovered how fun statistic modelling is, and usually I use already clean datasets. However, I am dealing with a credit default dataset that a lecturer showed me as a challenge. I want to do a logistic regression, a random forest, and XGBoost...
  9. B

    Alternative to Spearman correlations in R when data is not independent?

    Hi everyone, I'm working with a dependent variable which is the number of individuals of an species. The way in which we counted the individuals is along transects, so we have number of individuals in at least 7 plots at different distance from a plantation (from 0-20 m, 20-40 m, 40-60 m, etc)...
  10. R

    a function created does not work

    Hello, I had created a function and I aimed to verify if it complies with certain data and if it was, then it is stored in another variable. data = c(12, 20, 11, 16, 18, 32, 22 , 8) class = function(N){} tabla1= c(1:8) for (i in length(N)){ if (data[i]<21.78){ table1[i]= data[i]...
  11. A

    Test for Multicollinearity

    Hello Talk Stats Forum! I am working on building a Predictive Model using the binary logistic regression and LASSO logistic regression. In order to apply these models on some real data set I am using R software. Before performing such a model I am testing for multicollinearity and will remove...
  12. D

    [R] Probability of sample proportion given true proportion

    Hi everyone, First post here. I am looking for feedback on the results of my analysis of a sample proportion. My aim is to determine the probability of observing a sample proportion given a true proportion. In my example, my true proportion is 0.85 and my sample proportion is 0.82. My sample...
  13. L

    Estimating Likelihood of NFL Game Outcomes

    Hey all, similar to last year, I'm passing along the tracker for the top 4 statistical model trackers for the season. https://tinyurl.com/ybwyffu3 Good news is that they are all at 100% so far...
  14. A

    How to deal with individual pseudoreplication?

    I am trying to deal with pseudoreplication of individuals in my study, and not quite sure how to handle it. I have been trying to account for individuals being sampled multiple times (twice usually) using a GLMM with individual ID as a random intercept. However, I think that the number of ID's...
  15. A

    Markov chain with covariates

    Hi everyone, My first post! :-) I apologize for how long it will be, but please bear with me. I am looking for help in a topic related to Markov chain modeling with covariates. I have a decent knowledge of the underlying theory, but not exactly how to implement some aspects of it in practical...
  16. L

    I need someone to write me a basic code please!!

    Hi, I am learning basic programming with R, and I desperately need someone to write me a PSEUDO code and code for it please: Here's the situation "you have been sentenced to die tomorrow, but you're offered a way out... you get given 12 red balls and 12 blue balls together with two urns...
  17. R

    GLM question

    Hi guys, I have done my GLM model fitting on R and I was wondering if someone could help me with the following question : What is the probability for a male student to be admitted to department B? We have to use 'fit1' to answer the above question but I can't quite figure it out...
  18. D

    Tukey's HSD following repeated measures ANOVA using ezANOVA package

    Hi, I have a longitudinal balanced tendon injury study with two treatment groups of horses (n=6/group) with 5 measurements over 6 mos measured on multiple MRI sequences. I have multiple questions with how I want to analyze this information, but my current question is the most pressing: Below...
  19. S

    lm for multiple regression hangs up

    I'm new to R and came over strictly to do a regression on a dataset with 28 variables and 60k entries (excel limits you to 16 variables). I watched some tutorials, read some guides, then wrote this script with the hope that I would easily get the results: mydata2 <-...