Search results

  1. Y

    F test not significant but coefficients are

    Dear all, I ran a model in SAS, a linear model. My dependent variable is continuous and I had one important independent variable which is categorical, and a few covariates. I asked SAS to give me the LSMEANS for that independent variable (which has 3 levels). I got a non significant F test...
  2. Y

    Time Series Data with both Daily and Monthly Variables

    Dear all, I have daily data on how many people entered a certain shopping center, and the weather on that day (temperature). I wish to find out if there is a relation between the weather and the number of people who entered the shopping center. In addition, I have covariates such as the...
  3. Y

    Setting up a mixed model

    Dear all, I have data on 400 school students. For each students I have three dependent variables, all continuous. In addition, I got several independent variables, such as the student age, gender, etc,... Some students come from the same class. In the file I have data on the teacher: Age...
  4. Y

    False Discovery Rate and the BH method

    Dear all, I am trying to figure out the BH method for controlling the FDR. The formula for the BH method is to reject all hypotheses up to the Kth hypothesis where k is defined in the attached photo. Assume that I have 10 hypotheses, and the P-Values are: 0.01, 0.11, 0.21, 0.31, 0.41, 0.51...
  5. Y

    Reporting Log Transformed T-Test Results

    Dear all, I have a variable, I'll call it Y, which is skewed, and another variable X, which is binary. I wish to perform a t-test. I have calculated the LOG transformation of Y (using a base e), and ran a t-test on the transformed data, yielding a p-value of 0.046. The CI limits for the mean...
  6. Y

    Histogram with ggplot2

    Hello all, I have a simple dataset, and I wish to plot a histogram of the variable "Age". So far simple enough. I ran this code using ggplot2: ggplot(data=Votes, aes(Votes$Age)) + geom_histogram(breaks=seq(10, 100, by = 10), col="red", fill="blue", alpha = .2) + labs(title="Histogram for...
  7. Y

    Confidence Interval Simulation

    Looks like it, thank you !!
  8. Y

    Confidence Interval Simulation

    Hello all, I am trying to write a confidence interval simulation in R. The idea is to simulate several samples from a known distribution, calculate the mean and 95% CI for the mean, and then plot all confidence intervals in such a way that every confidence interval catching the "unknown...
  9. Y

    Frequency Distribution by Groups

    Hello all, I am trying to get a frequency table by group in R, similar to what PROC TABULATE gives in SAS. I have tried: temp = table(diet$Diet,diet$Gender) And it gives me a table of frequencies for the diet variable by Gender. However, it gives no percentages, just the frequencies...
  10. Y

    Replacing all instances of -99 to NA

    Deal all, I wrote this user defined function. It should get a dataframe ds and a number x, and replace all instances of x to missing values. When I ran the loop without defining a function, it worked. But after I put this code in a function, it does nothing... What is wrong with my code, why...
  11. Y

    Loops and Conditions with a Data Frame

    Hello all, I am moving from SAS to R, and getting a few difficulties. I have a data frame called DF. It contains 3 variables (see attached picture). The task I am trying to perform is simple. Where the variable SubjectID2 is missing, I want to copy the value of SubjectID into it. Both...
  12. Y

    Descriptive statistics

    Hello I have some data and I am not sure what is the best way to present it. I have a skin disease, let's call it A. There is a treatment for dealing with it, and a new treatment is being tested. The response variable here is measured from 0%-100%, i.e. percentage of skin healed...