Forum: open-discussion
Monitor Forum | Start New ThreadRE: Variable labels [ Reply ] By: Sara Hart on 2013-03-28 15:58 | [forum:39350] |
I'm sorry, I was incorrect before. The SAS code does allow for a rename of the variable names into descriptive names. Take that additional information as you will... |
RE: Variable labels [ Reply ] By: Sara Hart on 2013-03-28 14:02 | [forum:39345] |
Thank you both Mike and Will for you response, Will, you are correct with deciphering what I was trying to say! I was wondering if R allowed for variable labels, which it seems that's not really the way R works. For me, I don't typically need labels and am fine with variable names only, but the NLS var names are so undescriptive, and the process in R (or SAS) to change the var names intensive with many vars, I do use them with these data to help guide me. The NLS code for SAS does not change var names, only adds the labels (and other format things), so no real use to add that as part of your system. In the end, this is definitely a small issue and one easily fixed by coding in new descriptive var names like you suggest. In playing some more, I think I have come to the conclusion that I am definitely one of the people who would appreciate "6 Example: Midstream data manipulation with SAS" from the vignette (I may have even been one of those suggesting it at BGA last year). I can see the ease of using R to bring together the most uptodate links and outcome data (and wow double entry is easy this way!), but I am much more comfortable in SAS for analyses. SAS can pretty easily bring in a .csv file through a proc import statement, so to answer your question in the vignette I would say that's fine. If you would like, if you supply the R code to save out my newly combined data in R as a .csv, I will test out bringing it to SAS. |
RE: Variable labels [ Reply ] By: Will Beasley on 2013-03-28 01:24 | [forum:39333] |
Hi Sara, I'm glad you feel comfortable posting here. Do I understand that you're not encountering errors. But rather you'd like to know if R has the capability to add variable *labels* (which are usually more verbose than variable *names*)? If so, the short answer is that R doesn't have that feature (correct me if I'm wrong Mike). In one sense, it's a limitation of R. But in another sense, it's because R has a different approach. When I'm running analyses & creating graphs (or other occasions where SAS typically displays variable labels instead of variable names), the context usually dictates what I want displayed. And I'd rarely want the full/long label that the NLS Investigator assigned. By now, I'm not sure I'd use the NLS labels if they were available. There are some types of R objects that do accept names and labels, but the stat functions you'd call typically wouldn't recognize them, or use them in the display. I'm sorry if this response isn't satisfying. However, I think we could add the following function to NlsyLinks. Tell us if you think if would be helpful: Do the NLS-generated SAS script rename the variable names too (not just the variable labels)? If so, we could create a function that (1) reads and parses the SAS script (as a text file), (2) pulls out those new variable names, (3) applies them to the R dataset, which effectively renames the variables. You'd use these new variable names in your code, and see them in your output. I think this would require you to write only one extra line of code (which points to the SAS script to pull from and points to R dataset to modify). We are very interested in making NlsyLinks accessible to users with a SAS background. So please tell us what you think will work best for you. Will |
RE: Variable labels [ Reply ] By: Michael Hunter on 2013-03-28 00:32 | [forum:39332] |
Hi Sara! Glad to see you using the package and the vignettes! I'm not sure I understand your question. So forgive me because I'm going to respond to your question with some of mine own. First, are you have trouble using R or SAS? Second, are you using the R function ReadCsvNlsy79() ? Third, if you're using R and have read the data into an object called myData, then have you typed the following into the R Console? names(myData) dim(myData) head(myData) summary(myData) Let me know! Best, Mike Hunter |
Variable labels [ Reply ] By: Sara Hart on 2013-03-27 23:12 | [forum:39330] |
Hi! I had the chance to use the older kinship links, and am happy to be starting a new project with the updated version, so first, thanks for all your hard work! Second, to out myself, I am a SAS user, and only an occasional reluctant R user. I've been working through your ACE models vignette to learn your new R package and I have successfully brought in my own NLSY outcome data through the .csv option (woot!). When I previously used SAS to being in the NLSY data, I ran the accompanying code which matched up nice descriptive variable labels to the data, but I don't see the same option for R. Is this possible? I have brought in more variables than I care to individually label myself. Thanks for your help (and I bet this will not be my only posting as I go through this...) Sara |