01-27-2025
emaguin
Quartz | Level 8
Member since
05-06-2019
- 81 Posts
- 15 Likes Given
- 1 Solutions
- 5 Likes Received
-
Latest posts by emaguin
Subject Views Posted 168 01-28-2025 12:29 PM 930 01-28-2025 11:41 AM 966 01-28-2025 09:39 AM 1132 01-27-2025 04:05 PM 681 12-18-2024 05:37 PM 1122 08-24-2023 12:41 PM 1129 08-24-2023 12:20 PM 1129 08-24-2023 12:17 PM 1157 08-24-2023 11:16 AM 839 03-02-2023 09:15 AM -
Activity Feed for emaguin
- Posted Re: substract a date variable from a datetime variable with difference being in years and decimals on SAS Programming. 01-28-2025 12:29 PM
- Posted Re: substract a date variable from a datetime variable with difference being in years and decimals on SAS Programming. 01-28-2025 11:41 AM
- Posted Re: substract a date variable from a datetime variable with difference being in years and decimals on SAS Programming. 01-28-2025 09:39 AM
- Posted substract a date variable from a datetime variable with difference being in years and decimals on SAS Programming. 01-27-2025 04:05 PM
- Posted reference all variables in data set in vector on SAS Programming. 12-18-2024 05:37 PM
- Posted Re: A) read correlation matrix into sas; B) use that matrix as input to proc corr to compute reliabi on Statistical Procedures. 08-24-2023 12:41 PM
- Posted Re: A) read correlation matrix into sas; B) use that matrix as input to proc corr to compute reliabi on Statistical Procedures. 08-24-2023 12:20 PM
- Posted Re: A) read correlation matrix into sas; B) use that matrix as input to proc corr to compute reliabi on Statistical Procedures. 08-24-2023 12:17 PM
- Posted A) read correlation matrix into sas; B) use that matrix as input to proc corr to compute reliability on Statistical Procedures. 08-24-2023 11:16 AM
- Posted Generating data on SAS Programming. 03-02-2023 09:15 AM
- Posted proc mixed influence analysis output on Statistical Procedures. 11-21-2022 05:32 PM
- Posted Re: multilevel beta regression errors on Statistical Procedures. 10-26-2022 12:42 PM
- Posted Re: multilevel beta regression errors on Statistical Procedures. 10-21-2022 09:46 AM
- Posted Re: multilevel beta regression errors on Statistical Procedures. 10-21-2022 09:16 AM
- Posted Re: multilevel beta regression errors on Statistical Procedures. 10-19-2022 03:11 PM
- Posted multilevel beta regression errors on Statistical Procedures. 10-17-2022 04:09 PM
- Posted Re: Q1: retain statement; Q2: finding my previous questions and their replies on SAS Programming. 08-31-2022 02:53 PM
- Posted Re: Q1: retain statement; Q2: finding my previous questions and their replies on SAS Programming. 08-31-2022 11:04 AM
- Posted Q1: retain statement; Q2: finding my previous questions and their replies on SAS Programming. 08-31-2022 10:45 AM
- Posted proc transpose on SAS Programming. 06-27-2022 04:12 PM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 2 2 3 -
My Liked Posts
Subject Likes Posted 1 01-06-2021 04:32 PM 1 09-30-2020 05:35 PM 1 08-25-2020 02:30 PM 2 08-02-2019 09:45 AM
01-28-2025
12:29 PM
"The most likely cause for getting age of 53 is that you messed up the order of the arguments and which one had DATE values versus DATETIME values so that you ended up calculating the number of years since 1960." YES. That is exactly what I did. Case closed. Thank you for your help and persistence and to all who replied, thank you. Gene Maguin
... View more
01-28-2025
11:41 AM
Hi, I see what you did and I can repeat it. So this means I have a deeper problem. When I look at the viewtable for my file, I see these exact characters: 06/08/2011 for dob and these exact characters: 18DEC23:18:48:18 for interviewdate. When I look at the viewtable after running the syntax you posted I see these exact characters: 18786 for dob and 2018544498. In my data file dob has a format of MMDDYY10 and interviewdate has a format of datetime16. In your file both are Number. Ok. Is there a way to convert MMDDYY10 to number? Is there a way to convert datetime16 to number? Maybe relevant. The dataset is exported from Redcap as a csv file and then read into excel and saved as an excel data file (xlsx) and that xlsx file is imported into sas through proc import (dbms=xlsx). Thanks.
... View more
01-28-2025
09:39 AM
Tom and all who replied. Thank you. I apologize to you for describing the problem in a way that mislead you. So. Starting over. I've read in a data file and in the data file are the two named variables, interviewdatetime that is a date time variable and an actual value is 18DEC2023:18:48:18, and dob that is a date variable and an actual value is 08JUN2011. I understand the point about date-time variables being in second since the time origin, spss does the same thing. And that date variables are days since the date origin, excel does that. It seemed to me that teen_age=yrdif(datepart(p_abday_t1),p_abday_t1); should work but the result is 51.43. From the two data values you can see the value is about 12.5 years. It may be that the variable order is reversed but if so the difference would be negative-easily fixed. I understand computation that has to be done. I don't know how to write the syntax to do the required computations. Thanks, Gene Maguin
... View more
01-27-2025
04:05 PM
Consider: teenage=(interviewdate - dob). interviewdate is datetime16; dob is MMDDYY10 specific numbers: (18DEC23:18:48:18 - 06/08/2011) = 51.43... so why not teen_age=yrdif(datepart(p_abday_t1),p_abday_t1); or x1=datepart(p_abday_t1); teen_age=yrdif(x1,p_abday_t1); I'm doing something wrong because i don't understand something. How do i do what i want to do? Thanks, Gene Maguin
... View more
12-18-2024
05:37 PM
Ron Cody shows this bit of code on his blog and Tom has a similar example in another reply. data New; set Original; array Nums[*] _numeric_; array Chars[*] _character_; do i = 1 to dim(Nums); if Nums[i] = 999 then Nums[i] = .; end; do i = 1 to dim(Chars); Chars[i] = upcase(Chars[i]); end; drop i; run; My specifics are a little simpler. * recode '.', '.p', '.s' to -99 for all variables; data par_teen1; set par_teen; array md{*} _numeric_; do i=1 to dim{md}; if (md{i} eq .p) then md{i}=-99; end; run; This is the result. 417 * recode '.', '.p', '.s' to -99 for all variables; 418 data par_teen1; set par_teen; 419 array md{*} _numeric_; 420 do i=1 to dim{md}; ERROR: Undeclared array referenced: dim. ERROR: Illegal reference to the array md. ERROR: Variable dim has not been declared as an array. 421 if (md{i} eq .p) then md{i}=-99; 422 end; 423 run; I've verified by inspection that the type of all vars (~170) are Num. I'm doing something wrong; tell me what it is. Thank you.
... View more
08-24-2023
12:41 PM
Thanks for pointing out that sas has a corr dataset and many more types as well based on the search you suggested. I understand your point but the format and structure of a sas type=corr data set is that for a matrix dataset in spss and I know to make them, I've made them and am making them. Example A.2+Figure A.3 in that search shows how to do that and the result. In her reply, Paige says that proc corr won't take matix input and that is what I thought was true when I looked at the proc corr documentation but I wanted to ask because my sas knowledge would only fill a thimble but one with a hole in it. I know that sas has IML and it can be used to do amazing things, including, I'm sure, computing a reliability coefficient but I don't know how use IML. I can do this in spss with two commands: matrix data and reliability (which accepts a matrix data file as well as regular data file as input). Thank you for replying.
... View more
08-24-2023
12:20 PM
I thought was true when I looked at the proc corr documentation but I wanted to ask because my sas knowledge would only fill a thimble albeit one with a hole in it. I know that sas has IML and it can be used to do amazing things, including, I'm sure, computing a reliability coefficient but I don't know how use IML. I can do this in spss with two commands: matrix data and reliability (which accepts a matrix data file as well as regular data file as input). Thank you for replying.
... View more
08-24-2023
12:17 PM
In her reply, Paige says that proc corr won't take matix input and that is what I thought was true when I looked at the proc corr documentation but I wanted to ask because my sas knowledge would only fill a thimble but one with a hole in it. I know that sas has IML and it can be used to do amazing things, including, I'm sure, computing a reliability coefficient but I don't know how use IML. I can do this in spss with two commands: matrix data and reliability (which accepts a matrix data file as well as regular data file as input). Thank you for replying.
... View more
08-24-2023
11:16 AM
Exactly what the subject line says. Given, for example, a correlation matrix of y1-y6 in text format, read it into sas and use that matrix as input to proc corr to compute the reliability of the scale defined by y1-y6.
... View more
03-02-2023
09:15 AM
Hi, I want to generate a data set. What i want to learn is the SAS commands to do this; the specifics i describe are not the focus per se. I want to add that i know how to do this in spss and there, as is true here, the issue is the commands. That said. Let's say i want to create 20000 records with each record having four variables: record number (_N_ ??), x1, a draw from a normal distribution with a mean of 3 and an SD of 2; x2, a draw from a uniform distribution with a range of 2 to 5 and y, the resulting value of this regression equation y = 3.0 + 2.0*x1 + 4.0*x2+err where err equals a draw from a normal distribution with a mean of 0 and an SD of 1.5. I expect that this is a trivially simple thing to do; i need to know the commands and how those commands are located in a data xxx1; set ??used??; run; code block. Thanks, Gene Maguin
... View more
11-21-2022
05:32 PM
This may not the right forum. Anyway, i running some very simple proc mixed (multilevel) models and specifying influence statistics. for example: ods graphics on; title 'var on age rise*age No outliers'; proc mixed data=no_outs; model var_rise=rise_rev agecenX rise_rev*agecenX/ solution influence residual outp=var_ageint_no; random Intercept/type=vc subject=evq_id; run; ods graphics off; Runs fine, no errors. Now the problem. I've learned that i can save the output (results) and show it to others later; it's just html; opens in any browser. So i do the same thing here and look at the saved output. I'm stunned: all the plots are GONE and replaced by little colored squares in the upper left. I want to show that output and it's going to be looked at on a computer that does not have sas installed. AND even if sas were on that computer and i open an output file through sas those plots are still gone! Let's say i don't know enough to know what to do. What do i do? Thanks.
... View more
10-26-2022
12:42 PM
Steve, Thank you. I would never have found that. I'll try it out but it certainly looks like it is what I need. One thing I noticed that that clicking on the complete code link is a dead end. Searching on "sas glimmix" and clicking on first result (https://support.sas.com/rnd/app/stat/procedures/glimmix.html) gets to a page with "SAS/STAT Software" as the heading. Under the examples is the example you pointed me to but there it is listed as Example 49.4 (and the link to the complete code works). So, who knows why; it like going into your familiar grocery store and nearly everything has been rearranged. Again, thank you.
... View more
10-21-2022
09:46 AM
I can a copy from the library. Thanks for the recommendation. I'll try RSPL. I understand your alternative; I read about it in an ecology statistics book. Help me learn something. How would this be implemented? Our data is the computed proportion (because the dataset was originally analyzed assuming a normal distribution). I assume that that data won't work for the alternative method. Would I have to go back to the original data where each record represents an instance where a call was made? I know that the spss procedure genlinmixed allows the data to be expressed as the number of successes of the number of attempts, where the number of attempts can be a variable in the dataset. I just assume sas can do that, why not, but does glimmix have that capability? If so, where/how would it be documented? Lastly, the other problem is proportions of 0.0 or 1.0. In these current analyses, those values are recoded to 0.005 and 0.995, respectively. What happens in a logit formulation? Discarded as undefined? Given an arbitrarily large or small value, which is what mplus apparently does? I agree that your proposed model is a better representation of the data. The question is implementation.
... View more
10-21-2022
09:16 AM
I don't believe i have technical skill to create a plausible beta distribution test data model. I want to ask about the meaning of the three error messages that I'm seeing. These are ERROR: QUANEW Optimization cannot be completed. ERROR: The function value of the objective function cannot be computed at the starting point. ERROR: Infeasible parameter values for evaluation of objective function with 1 quadrature point. What do these mean in terms of where the estimation process is failing. To me they are pretty opaque and I'd like to understand what is happening.
... View more
10-19-2022
03:11 PM
Rick_SAS: I'm not the PI. May not be possible. All: Ecological Momentary Assessment dataset. Longitudinal. 9 time points. Persons are (attempted to be) assessed by a single yes/no item once each day at wake-up ("Wake-up") and then at four random times during the following 12 hour period ("Random"). Each time point is a 7 day period. Each person has a Wake-up proportion and a Random proportion at each time point. Wake-up proportion is the count of Yeses at wake-up (0-7) for the week divided by 7 days. Random proportion is count of Yeses at the random times for the week (0-4*7) divided by 4*7=28. Number of persons at week 0 is ~255 and at week 9 is ~230. In the model statement "slope" is time point variable and assesstype is the Wake-up vs Random indicator. Tried pseudo-likelihood? No. (Quadrature was recommended). I see that there are four PL options (RSPL | MSPL | RMPL | MMPL), which would you try first (why, please), then next? Thanks, Gene Maguin
... View more