Search results

  1. M

    Modeling number of days in a clinic

    Thank you Smith. It is the first time I am modeling length of stay. I will take a closer look at log of LOS. Thank you again!
  2. M

    Modeling number of days in a clinic

    What do you mean? subtract discharged date/time minus admission date/time? I have this variable as the dependent variable? I did this by round to days. ex. some patients have 3, 6, 90 days in the clinic. Can you elaborate?
  3. M

    Modeling number of days in a clinic

    Hello guys, I wish to model the number of days patients stayed in a clinic. Some of my predictors included: type of injury/disease, age, insurance, etc. Since days are count data and my data is over-dispersed, negative binomial models seem to be the appropriate technique. However, I know that...
  4. M

    logistic regression or survival analysis?

    Hello, I have two main questions that I hope you help me answer. Let me give you the scenario first. Let’s say that some students in a school are assigned to 3 different programs after being involved in a fight. The aim of the program is to prevent students from fighting with each other. My...
  5. M

    Generating rates: individual level or aggregate??

    Using approach 1; the average number of infraction per 100 days is 0.7 and option 2 ((7/175)*100)=0.9
  6. M

    Regression: Independent variable (proportions) with missing values

    Hello, My dependent variable is counts of fights in schools. My independent variable is the schools’ proportion of students with a single parent. I hypothesized that schools with higher proportion of students with only one parent will have more fights. I used a negative binomial regression...
  7. M

    String: Pull characters before "-"

    Hi guys, I have a string variable that looks something like this: MMDC-6MA. I need to extract the first letters before the sign "-", So I need GMDC. Any ideas? Thank you, Marvin
  8. M

    Census data: Should I worry about sample size and pvalues?

    Hi all, I have a questions regarding statistical power and sample size. (1) Do I have to worry about sample size in a multiple logistic regression if I am using all the individuals in a population (census) and not a sample? Let’s say that I want to see how many tourists in a resort report a...
  9. M

    Pre and post with control: Difference in median

    I created the difference between pre and post UOF counts and then generate a variable that represents the median for each group. base on my calculations the median difference in pre is 2 UOF and post 2. Thank you, Marvin
  10. M

    Pre and Post with Treatment group - ANOVA , ANCOVA, Regress differences???

    Hello friends, My main task is to "test" if staff member who participated in the counseling sessions had fewer "Use of Force (UOF)" incidents in the 6 moths after the counseling session. I have a data set with the number of UOF incidents for the staff member in the 6 months before (pre) and...
  11. M

    What model should I use? Mixed-effect model?

    Hello guys, I really hope you can help me with this. Any ideas/suggestions are welcome. My main goal is to create a model that predicts which staff member is more likely to use force (UOF) in a mental health center. The goal is to detect these officer and prevent them from using force. To...
  12. M

    Save graph vs saving

    Hello guys, What is the different between the "saving" options at the end of the command and the new command save graph filename? I have a do file with a serious of command including charts. When I use the command below and run the file multiple times I got the following error message...
  13. M

    Do I have a non-linear regression?

    Hello everyone, I want to start by saying that I don't have too much experience working with continuous dependent variables. I have worked more with Logistic regressions. I want to test if the numbers of Use of Force (UOF) a staff member of a mental clinic had in year 2014 predicts the...
  14. M

    New ID variable using date variable

    I have a ID# for all my teachers but I noticed that there are some instances that an 2 or more teachers can have the same ID#. I want to create another unique ID# for teachers using my old ID # plus the month and date of their birthday. I have a day of birth variables which is storage as date...
  15. M

    String date to date variable

    I have a string variable containing dates (1/28/15) (DAateToday) and would like to make it a real date variable. I tried: gen RealDate=date(DateToday, "MDY") But it didnt work. After I have my date variabel I would like to create a variable that only includes the month and year...
  16. M

    Remove the time of a date variable

    Remove the hour of a date variable I have a date variable that looks like this: 01apr2014 17:06:55 The storage type for this variable is double and display format %tc I just need the date, that is 01apr2014. How can I delete the time. Thank you, Marvin
  17. M

    Methods section- can I use the term inferential statistics if I dont have a sample

    I am writing a report and need to write a very brief method section. I basically describe my sample (frequencies), some cross tabulations, and see the efffect of our program betwee pre and follow uo examinations. I used mc nemar test, pair sample ttest to see if there was an increase in...
  18. M

    Do file stops - freezes

    Hello guys, I am running a stata do file that was working perfectly in the past and now it freezes and does not work properly. It freezes in the part that I run a logistic regression. Perhaps this is do because my dataset is bigger now- 45,000 obs. It thinks for hours and says "log on...
  19. M

    Count values of a variable based on another variable

    How can I count the number os Grantees that have used the ipad to collect participants information. In this case, 2 grantees CA0083 and CA0214 used the ipad. My variables are agency, datamode (excel, ipad and scan). This is a clinet level dataset. DataMode Agency EXCEL IPAD SCAN Total...
  20. M

    Create a variable based on a hierarchy

    Hello friends, I have a dataset where each services offer by providers is in one row. However my goal is that each provider represents one row. I would like to create a variable that represents the LEAD grantee of my provider. Note that providers can have more than one grantee. For...