On what basis can I analyze the piece of writing? Like, what are the things that tells me writers state of mind, or certain effects that a writer has tried to create for a purpose or why has the language used in the writing the way it is?
On what basis can I analyze the piece of writing?
Well, that's complicated. And it depends on whether the writer is aware of these effects before and during writing. Let's get to some examples. (Sorry @LameZeldaPun, but yours is the perfect example)
You should concentrate on the effect not the cause. Sometimes I screw up so badly I get downvotes to my questions weeks later, but sometimes I don't. And I have NO IDEA WHAT I'M DOING.
What we have here is, first, a piece of heartfelt advice. "Focus on the why, not the what." This is true, because our emotions can have us select words we're not consciously aware we're picking, or write about topics we normally wouldn't.
We then slip into something the commenter was just grappling with (another question), where this exact subject comes up. This is the up and downvotes.
Then comes the frustration. "I DON'T KNOW WHAT I'M DOING!"
Having said all that. Let's look at my writing now (it's only fair, since I don't want anyone to think I'm picking on them).
When I'm in a dark mood, I use different language that when I'm in a light and airy mood. So word choice. Compare:
Sigh. You'd think after being Jounin Commander for over ten years, people would get used to the notion that I know what I'm doing. You know what, it's too troublesome to go over those last three meetings. I just need to get home, have a few beers, and figure out a way to show Aya I'm trying to help her in any way I can.
(taken from Butterflies: Solidarity, a Naruto FanFic I wrote) With:
"Go away, Ginny. I can't do this, not today." I tell her honestly. Hearing the crackling voice bleeding out of my vocal chords only summons more tears... I don't want to think about school, meeting new people, having to deal with the stupidity, the idiocy and the constant questions. Any of it! I just...
(taken from Exordium: Freedom, a Harry Potter Fanfic I wrote).
I am overly aware of my word choice. So look at the difference here. The first comes from Shikaku Nara, a lazy genius that is more exasperated than anything.
The sighing, the analysis, the catchphrase 'troublesome'. It's meant to really capture someone that is used to thinking about things, but often is just annoyed because he's too used to thinking about things.
The second comes from an original character of mine, in the throes of depression. Her 'crackling voice bleeds'. This is super specific to this fic, to this situation, because she is a trans girl at the cusp of male puberty, and she's suicidally depressed because she feels like there's no happy ending anymore.
At the end of the chapter that snippet comes from, the character jumps off a literal cliff, to commit suicide. By using visceral words, I hope to subconsciously alert the reader before more direct clues pop up.
Instead of only looking at word choice, why not take the bigger picture, and let's look at choice of subject matter?
In this let's look at not just what is being written about, but what is being purposely avoided. Again, we'll use my work, though you're just going to have to trust me on this.
Years ago, I avoided anything LGBT related. Because I was too deep in the closet, so it was forbidden. This ties in perfectly with the two snippets I offered up earlier, because Butterflies: Solidarity is an f/f romance. And Exordium: Freedom is in fact a trans lesbian's tale.
But here's the major difference between them. Butterflies is more recent, so while it deals with heavy themes like depression and suicidal ideation and sexuality (as is the case with Exordium), when I started writing Butterflies, it was coming from a better place mentally. I was already out of the closet, and life (while hard) is worth living. Exordium was written in the throes of my own struggle with suicidal ideation and attempts.
So there was always a happy ending in mind for one, and there was only a dark journey for the other. Where I was mentally at the time of plotting and writing had (has) a supreme and almost devastating effect on subject and where the protagonist's journey would lead them.
So, you can parse where I was/am just by reading what I write. With word choice, with subject matter, and with the direction I want it to take. It says something about the writer, all you need to do is look hard enough, and the clues will be there for you.
Look at "Lie to me", it has a lot of those little tells you can pick up (while being entertaining).
On what basis can I analyze (a) piece of writing?
If you're asking how you can achieve standing to analyze a piece of writing -- you have to read it. That's all :) Once you've read something, you're qualified, as a reader, to examine, interpret, and draw conclusions about the thing you read. In fact, I don't think you can avoid it! Some prominent critics think you can even do this without actually reading the work, though I think you'll do a better job if you do read it.
If you're asking how to do it well, that's not horribly difficult either. The main challenge is picking a scope and consistently using evidence from that scope.
So what do I mean by scope? The scope of analysis is the body of evidence you can draw from in order to form and support your conclusions. For example, it is perfectly valid to use the scope of your experience as a reader. If you choose that scope, though, draw your evidence from that scope and restrict your conclusions to the same scope. If you say, "when I read this passage (possibly quoting it), i felt or experienced this thing", and then use that feeling as evidence, conclusions about the author's thought process or London in the 1800s won't be well supported.
You can pick any number of different scopes though, if you want to draw other kinds of conclusions. If you did want to draw some conclusion about London in the 1800s while analyzing A Tale of Two Cities, then that's your scope (and you need evidence from that scope). Find some letters, articles, or other historical source material, combine that with evidence from the text itself, and draw your conclusions from that.