# Search results

1. ### 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...
2. ### 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...
3. ### 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
4. ### 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...
5. ### 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
6. ### 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...
7. ### 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
8. ### 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...
9. ### 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...
10. ### 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...
11. ### 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...
12. ### 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...
13. ### 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...
14. ### 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
15. ### 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...
16. ### 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...
17. ### 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...
18. ### 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...
19. ### egen count only but unique values

Hello, Below is how my dataset looks like: GranteeID ProviderID 11 11 12 11 26 27 78 27 78 27 33 33 33 33 33 33 I am trying to count the number of unique GranteeIDs by ProviderID. This is my attempt: egen grantee_count = count(GranteeID), by(ProviderID). However, grantee_count is not...
20. ### Reshape, collapse, restructure

Hello guys, These are my variables: GranteeID Funding= Funding type there are 4 funding types (a,b,c,d) ProviderID=provider of the services Services= type of services (there can be 5 different type of services). In this dataset the services is the unit of analysis. Basically, I want...