R Programming
R Sort a Data Frame using Order()
In data analysis you can sort your data according to a certain variable in the dataset. In R, we...
A variable is a concept or theoretical idea which can be described in measurable terms. This term refers to the qualities, characteristics, or attributes of a specific object, individual, or situation which is being studied.
For instance, age is considered as a variable because age can take different values for different people or for the same person at a separate time duration.
Another example is the income of an employee which is considered as a variable. It is not only something that we measure but also something which we can easily manipulate and control.
Variables are further divided into two types:
Let us learn them in detail:
An Independent variable is exactly according to its name. It means it stands along with a variable that cannot be changed by another variable. Independent variables are also known as prediction or factor.
The dependent variable is the variable that is measured or tested in an experiment. It is the result of the participants' actions, which can be changed according to the outcome of the action performed by the participant.
Let us assume that teacher asks 100 students to complete a science test. By doing this, she wants to know why some students score better than others.
Here the teacher does not know the answer. Therefore she thinks that it might be because of the following two reasons:
The teacher decides to analyse the effect of revision time. Based on the test performance of that 100 students.
Which are the dependent and independent variables?
Dependent Variable:
Independent Variables:
Now let see another example:
How increment affect employees' motivation?
Independent variable: Increment
Dependent variable: Employees motivation
How higher education can lead to higher Income:
It is causally affected by education and itself affect Income.
When you plotted in graphs, the convention is to use the independent variable as the x-axis and the dependent variable as the y-axis.
The DRY MIX can help keep the variables straight:
Here are different between Independent and Dependent Variables:
| Independent variables | Dependent variables |
| An Independent variable is a variable whose value never depends on another variable but the researcher. | A dependent variable is a variable whose value depends on another variable. |
| The Independent variable is the presumed cause. | The dependent variable is the presumed effect. |
| Any change in the independent variable also affects the dependent variable. | Dependent variable changes, then the independent variable will not be affected. |
| Independent variables are the predictors or regressors. | Dependent variables are often referred as the predicted variable. |
| Independent variables can become easily obtainable and do not need any complex mathematical procedures and observations. | Dependent variables are obtained from longitudinal research or by solving complex mathematical equations. |
| Independent variables are can be manipulated by the researcher. So he or she is biased. Then it may affect the results of the research. | You cannot be manipulated by the research or any other external factor. |
| Independent variables are positioned horizontally on the graph. | Dependent variables are positioned vertically on the graph. |
In data analysis you can sort your data according to a certain variable in the dataset. In R, we...
WinZip is a zip tool program that can be used to compress and decompress files with no hassle. It...
Before learning about SDRAM and DRAM first, we need to understand about the RAM What is RAM? The...
It's time to make the big switch from your Windows or Mac OS operating system. Mac OS uses a UNIX...
Almost all websites recommend an array of books and the readers are left confused deciding which...
Here are MuleSoft interview questions for fresher as well as experienced candidates to get the...