r coding

  1. H

    correcting with poisson regression

    Hi everyone, I'm new to stats and I was wondering if anyone had any good resources that could explain to me: How one can correct their data (false-positives) using poisson-regression. I've been looking for some resources to explain it simply and give a step by step (in r ) but I've had...
  2. U

    Efficient R coding

    Consider the following data frame: dat <- data.frame(x=c(0,128.96,0,397.37,56.80,0,801.79,340.79), y=c(40,97,172,186,210,246,327,432), d=c(1,0,0,0,0,1,0,1), A=c(0,1,0,1,1,0,1,1), B=c(0,1,0,1,1,0,1,1)) For each value of the column y which satisfies...
  3. W

    R - Logistic regression. Coding to get all predictor variables for categorical vars

    I'll preface my question by stating that I am new to using R. I am trying to use logistic regression on my data. I typed glm(formula = purchase ~ predictor vars separated by + sign, family=binomial, data=modeldata) The solution does not produce the multiple intercept and beta coefficients for...
  4. S

    Bootstrapping code help needed in r??

    Hello friends. So I am ready to jump off a building because I cannot figure out this code for my LIFE. Everytime I run it, I get the standard error of 0 (bias=0 too) so obviously I'm doing something wrong because it's using the same sample when I want 1000 iterations. I want the AIC of the...
  5. R

    Fitting confidence interval lines in R using the predict function

    Hi everyone, I am currently attempting to fit confidence interval lines to a regression model in R, but every time I try to for example add a +2 confidence interval line, I end up with two of them! I have been over my code many times and can't find any obvious mistakes. This is the code I...