- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to figure out how to run a Box Cox transformation on a continuous response variable (Frond Length) when I do not have continuous explanatory variables (they all are categorical).
This link shows how to run a Box Cox transformation without an independent variable.(https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_transreg_se...)
However, I cannot seem to run the code that will read my specific dataset that also includes a column of zeros. It will return errors saying that my 'Frond.Length'n and 'Zero" are not found. I am not sure how to include a line of codes that will read my dataset (the one I wrote below is definitely wrong). How do I modify the code to do that?
Thanks!
My code below:
title 'Univariate Box-Cox';
data WORK.Data_Final_noAugust_SS_0001;
run;
proc transreg maxiter=0 nozeroconstant;
model BoxCox('Frond.Length'n) = identity(Zero);
output;
run;
proc univariate noprint;
histogram 'Frond.Length'n t'Frond.Length'n;
run;
ods graphics off;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You should comment your code so we understand what you think is happening.
Here's an example:
*this actually destroys the data_final_no_augst data set - you will need to recreate it; data WORK.Data_Final_noAugust_SS_0001; run; *you do not have a data= statement here so you are not using any dataset so you will get the wrong results. will default to the last used data sets which will not be the above one because it's gone; proc transreg maxiter=0 nozeroconstant; model BoxCox('Frond.Length'n) = identity(Zero); output; run;
What you probably want:
This assumes you input data set is in a library called mydata. If it's not or you're not familiar with the concept of a library, you can revisit some of the earlier tutorials or check video.sas.com and working with your own files.
data WORK.Data_Final_noAugust_SS_0001;*newly created data set; SET mydata.data_final_noAugust_ss_001;*refers to input data set; run; proc transreg data = data_final_noAugust_ss_0001 maxiter=0 nozeroconstant; model BoxCox('Frond.Length'n) = identity(Zero); output; run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You should comment your code so we understand what you think is happening.
Here's an example:
*this actually destroys the data_final_no_augst data set - you will need to recreate it; data WORK.Data_Final_noAugust_SS_0001; run; *you do not have a data= statement here so you are not using any dataset so you will get the wrong results. will default to the last used data sets which will not be the above one because it's gone; proc transreg maxiter=0 nozeroconstant; model BoxCox('Frond.Length'n) = identity(Zero); output; run;
What you probably want:
This assumes you input data set is in a library called mydata. If it's not or you're not familiar with the concept of a library, you can revisit some of the earlier tutorials or check video.sas.com and working with your own files.
data WORK.Data_Final_noAugust_SS_0001;*newly created data set; SET mydata.data_final_noAugust_ss_001;*refers to input data set; run; proc transreg data = data_final_noAugust_ss_0001 maxiter=0 nozeroconstant; model BoxCox('Frond.Length'n) = identity(Zero); output; run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You could check PROC MCMC 's documentation, One of its example is about Box-Cox transformation.